Perl scripts start with a shebang line and it's good practice to always include use strict and use warnings:
#!/usr/bin/perl
use strict;
use warnings;
print "Hello, World!\n";
Run the script from the command line:
chmod +x hello.pl
./hello.pl
# or
perl hello.pl
The say function (use Perl 5.10+) is like print but adds a newline automatically:
use 5.010;
say "Hello from Perl " . $]; # $] holds the Perl version number
Perl is available on virtually every Unix-like system. Check your version:
perl --version