4.3. Environment

On the command line one can type:

perl -e "print 42"

perl -v

perl -V

Example 4-1. examples/intro/hello_world.pl

#!/usr/bin/perl
use strict;
use warnings;

print "Hello world\n";
print 42, "\n";
run it by typing perl hello_world.pl

On unix you can also make it executable: chmod u+x hello_world.pl and then run like: ./hello_world.pl

A couple of notes