Perl Monk, Perl Meditation | |
PerlMonks |
Re: Value of a statement with modifierby davidrw (Prior) |
on Jan 22, 2007 at 16:56 UTC ( [id://595941]=note: print w/replies, xml ) | Need Help?? |
from perlsub: "The return value of a subroutine is the value of the last expression evaluated." this is a nice and subtle example (i had to run it too).. $_[0] is the last expression evaluated when the unless fails, so the sub just ends up returning the first argument.. good example for always using explict returns ...
In Section
Meditations
|
|