|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: Perl: last evaluated value as a returned value for a subroutine. See insideby choroba (Prior) |
| on Feb 21, 2013 at 17:05 UTC ( #1019985=note: print w/ replies, xml ) | Need Help?? |
|
If you do not want the last value, return something else:
Usually, your subroutine should return a value and not print anything, or it should print something, but then you should call it in a void context (or a boolean one, checking for success). Making it both print and return a value to be printed makes it harder for reuse.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||