Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

02 Sample Code


#Put the following two lines in a text file, such as myscript.pl:

#!/usr/bin/perl
print "Hello World" ;

That 's it - the entire Perl script.  To run the program type
in the following at the command line:

perl myscript . pl


#The Perl executable reads the text file
#and executes any statements it finds.

#The first line "#!/usr/bin/perl is the location
#of the Perl executable.  Is only needed in
#UNIX.  It is not needed in Windows.

#Text after the # symbol is treated as comments