- or download this
my $bool = not (1==1);
if ($bool eq "") {
print "False stringifies to the empty string.\n"
} else { print "Nope.\n" }
- or download this
my $bignum = 1000;
for (1..1000) { $bignum *= $bignum }
print "bignum is now $bignum\n";
my $epsilon = 1/$bignum;
print "epsilon is now $epsilon\n";
- or download this
my $foo = 3;
my $x = print($foo) + 7;
...
# Here print is used as a statement,
# but mult (a function) is used as a list operator.
print "\n";
- or download this
print join "\n",
split(/\s+/,"Just Another Perl Hacker"),
"\n";
- or download this
int main()
{
...
sprintf (buf, "Hello %s here\n", a);
printf ("%s", buf);
}
- or download this
my $count = @{[@foo, @bar, @baz]};
print "There are $count elements altogether between the three arrays.\
+n";
- or download this
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/