About Perl Setting
up the Perl Environment
- All the CSUG lab computers have Active
Perl. Make sure that the system path contains the path to the perl
interpreter (e.g. -- C:\Program Files\Perl)
- We can create the Perl files in Notepad.
Perl code is typically written to text files and have ".pl" file
extensions
- To run a Perl program, type the
following at the command prompt (where hello.pl is a text file): "perl
hello.pl"
- When the file is executed, Perl first compiles it
and then executes that compiled version. (So, you can get compilation errors
when you execute a Perl file which consists only of text.)
- If something goes wrong then you may get error messages, or
you may get nothing. You can always run the program with warnings using the
command "perl -w
hello.pl" at the prompt. This will
display warnings and other (hopefully) helpful messages before it tries to
execute the program.
- To run the program with a debugger use the command "perl
-d hello.pl"
- Debugging can also be done using print
statements