Perl::Tutorial::HelloWorld - Hello World for Perl
#!/usr/bin/perl # # The traditional first program. # Strict and
warnings are recommended. use strict; use warnings; # Print a
message. print "Hello, World!\n"; Open a text editor, and type
in the above program. Save it in a file named "hello". Then open
a terminal window. First ensure the file is given executable
permissions: chmod u+x hello Then you can run the program using
either of the following: ./hello perl hello You should see it
print "Hello, World!" to the console. Every Perl program should
start with a line similar to one of these: #!/usr/bin/perl
#!/usr/bin/env perl or on Windows: The first line is known as
the "shebang line", and is used by UNIX-like systems to look up
the path to the Perl interpreter. Comments in Perl always start
with a '#' character: # This is a single-line comment. # This
comment extends over two lines # to illustrate multi-line
comments. print 'hello'; # And here is an inline comment.
Anything to the right of a '#' will be ign