Perl Programming/First programs

A first taste of Perl
Here's a simple program written in Perl to get us started:

Let's take a look at this program line by line:


 * #!/usr/bin/perl
 * On Unix systems this tells the Operating System to execute this file with the program located at /usr/bin/perl. This is the default Unix location for the perl interpreter, on Windows #!C:\Perl\bin\perl.exe  or #!C:\strawberry\perl\bin\perl.exe (depending on whether ActivePerl or Strawberry Perl was installed) should be used instead.


 * # Outputs ...
 * This line is a comment - it is ignored by the perl interpreter, but is very useful. It helps you to debug and maintain your code, and explain it to other programmers.


 * print "Hello World!\n";
 * The print instruction writes whatever follows it to the screen. The \n at the end of the string puts a new line to the screen. The semicolon at the end of the line tells the perl interpreter that the instruction is finished; you must put a semicolon at the end of every instruction in Perl code.

Exercises
de:Perl-Programmierung: Hello World Programación en Perl/Tu primer programa it:Perl/Primo programma: Ciao Mondo! Perl/Pierwszy program Perl/Primeiro programa