Writing Perl Scripts

Perl scripts are written for a couple of purposes in this book: as programs you invoke yourself from the command line, or as programs that you intend to run from a Web server in response to requests received over the network. (We’ll also write some scheduled scripts that are invoked as cron jobs, but those are essentially command-line scripts run automatically by the system.) This section shows how to write both kinds of scripts, but instead of starting out by writing something complicated, we’ll use the following progression of steps:

1.
Verify that Perl works by writing a simple “do nothing” script.
2.
Verify that you can access the CGI.pm and DBI modules.
3.
Verify that you can get Apache to execute a Perl script to ...

Get MySQL and Perl for the Web now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.