in reply to Perl: last evaluated value as a returned value for a subroutine. See inside
sub mySub { if ($R) { return; } else { print "CONDITION WORKS\n"; $R = "some string\n"; } }
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.
|
|---|