Monthly Archives: July 2009

Tilde-Tilde Operator

A bit obscure is the tilde-tilde “operator” which forces scalar context. print ~~ localtime; is the same as print scalar localtime; and different from print localtime;

Spaceship Operator.

Easy with theSpaceship Operator. $a =2<=>5;# $a is set to -1 $a =5<=>2;# $a is set to 1 $a =2<=>2;# $a is set to 0    

Non-Obvious features in perl.

For example, did you know that there can be a space after a sigil? $ perl -wle ‘my $x = 3; print $ x’ 3  Or that there you can give subs numeric names if you use symbolic references? $ perl -lwe ‘*4 = sub { print “yes” }; 4->()’ yes  There’s also the “bool”… Read More »