why not ben

ben tucker's virtual life. work, doings, incoming.

December 18, 2007 at 9:59pm
home

Perl Lesson Learned Today

$ perl -le 'sub x { 1 }; print x + 1'
1
$ perl -le 'sub x() { 1 }; print x + 1'
2

Yikes. Scares me a little I didn’t know that. In case it’s not clear what’s going on in the first one, that’s getting evaluated as x(+1).