PERL HOWTO ------------------------------------- BASIC SYNTAX Perl is case sensitive. Most code is typed in lowercase. The syntax is in some part similar to C. ------------------------------------- TOP LINES The following are recommended as first lines in Perl scripts: #!/usr/bin/perl -wT use strict; with no white space or blank lines before the #! The option -w gives warnings; The option -T checks security of cgi or suid/sgid scripts. The strict mode requires that variables are declared and makes debugging easier. -------------------------------------- FILE EXTENSIONS Under UNIX/Linux, file containing Perl scripts usually do not have any extension; on some occasions you see the extension .pl. -------------------------------------- RUNNING PROGRAMS The program file needs to be made executable by the following command, typed at the UNIX/Linux shell prompt: chmod u+x FILENAME To execute a script, type FILENAME at the shell prompt. To run the program this way, #!/usr/bin/perl or similar is required as a top line in the file. Running the program will cause that its syntax is checked and related messages displayed. ------------------------------------ CHECKING SYNTAX To check the syntax in FILENAME without running the program, type at the shell prompt: perl -c FILENAME ------------------------------------- ON-LINE HELP Execute at the shell prompt: perldoc -f push # Help on function push perldoc -m CGI::Carp # Source code of module CGI::Carp perldoc -q KEYWORD perldoc perlre # Help on reqular expression perldoc perldoc ------------------------------------ ON-LINE BOOKS Look up on-line books "Learning Perl" and "Perl Cookbook", following links from instructor's web page.