Monday, September 13, 2010

Running a perl program

Explicitly invoking the Perl compiler/interpreter
(note that >>> is prompt only)
>>>perl program.pl
Many command line options are available here eg.
-w print all warnings
-c check but do not execute
-d run under debugger control

Implicitly invoking the Perl compiler/interpreter
It is system specific. e.g. Unix
#!/usr/bin/perl
print "Please enter your name: ";
 This is popular shebang notation. Also you can do following:
#!/usr/bin/perl -w
for warning check etc like we do with command line options.

No comments:

Post a Comment