Tuesday, 7 February 2012

Perl Interview questions


I had this one thrown at me:

What is the difference between -
perl -e '$n=1234; if($n=~m/^(\d)*$/){print $1;}'
and
perl -e '$n=1234; if($n=~m/^(\d+)$/){print $1;}'

Thankfully I got it right, (I leave marks when I kick myself.)

No comments:

Post a Comment

About this blog

Sort of a test blog... until it isn't