Here is the basic perl program that we'll use to get started.
#!/usr/local/bin/perl # # Program to do the obvious # print 'Hello world.'; # Print a messageEach of the parts will be discussed in turn.
#!/usr/local/bin/perlalthough this may vary from system to system. This line tells the machine what to do with the file when it is executed (ie it tells it to run the file through Perl).
Everything else is a Perl statement which must end with a semicolon, like the last line above.
print
function outputs some information. In the above
case it prints out the the literal string Hello world.
and of course the statement ends with a semicolon.
You may find the above program produces an slightly unexpected result. So the next thing to do is to run it.