Chapter 8. Automating with LibWWWPerl

I have not failed. I’ve just found 10,000 ways that won’t work.

Thomas Alva Edison

Anyone who has spent a little time with Perl knows that it does a few things really, really well: it handles strings and pattern matching, it allows for rapid development of scripts, it is portable across platforms, and it can make use of a wealth of third-party modules that save you a lot of time. When you bring Perl to bear on your scripting, you leverage not only your own programming, but also the programming of thousands of others. Perl is also supported in major commercial testing systems, such as HP’s Quality Center.

To be fair, Perl has some disadvantages, too, which we will mention up front. Perl has been accused of being a “write-only” language. That is, writing Perl that does what you need is one thing; writing working Perl code that you can read six months later is something else. Perl’s motto is “there’s more than one way to do it.” That’s great most of the time, but it also means that there are a lot of variations in the modules you might use. One programmer thinks that procedural functions are the best way to express his solutions, while another thinks that an object-oriented approach is the best way for his module. You’ll find that you need to understand and live with the many paradigms Perl supports if you want to leverage other people’s work.

A Perl guru looking at the examples in this chapter may find them unnecessarily verbose. We’re trying to ...

Get Web Security Testing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.