Examples adapted from
Computer Science & Perl Programming: Best of the Perl Journal
Edited by Jon Orwant
O'Reilly, 2003
Chapter 7: What is Truth, by Nathan Torkington
#!/usr/bin/perl -w print $x
#!/usr/bin/perl -w print $xNote: blank line at top of file
#!/usr/bin/perl -w $x = 7; print $x;
#!/usr/bin/perl -w $x = 7; print "$x\n";
#!/usr/bin/perl -w
if (defined $x) {
print "x has value $x\n";
} else {
print "x is undefined\n";
}