Chapter 1. Syntax

1.1. Hello world

The code:

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

print "hello world\n";

How to run it:

$ perl
hello world

strict and warnings

It's considered bad form if you don't use strict and warnings in all your code.

Both aim to protect the developer from bad old syntax which the Perl interpreter accepts as valid but will most likely cause your code to behave unexpectedly and cause errors that are hard to debug.