June 2005
Beginner
480 pages
10h 31m
English
The debugger isn't the only feature of the Perl interpreter that can be activated by command-line switches. In fact, many useful Perl programs can be written just at the command prompt.
By the Way
Macintosh users should run these command-line examples by selecting 1-liners from the Script menu and then typing the command in the dialog box.
The key to such programs is the -e switch given to Perl on the command line. Following the -e can be any Perl statements at all, as in this example:
C:\> perl -e "print 'Hello, world';"
Hello, world
You can use multiple -e statements to insert multiple statements or separate them with semicolons, as shown here:
C:\> perl -e "print 'Hello, world';" -e "print 'Howzit goin?'" ...Read now
Unlock full access