in reply to Return Question in Subroutine
You always return undef for nothing and your code will work in the way you think and it is easier to read. Just replace that last bit with this.my @result = $object->cleanup; if (@result) { print "Got some results back '@result'\n" } __END__ # # You will always get this back if you do return ''; # Got some results back ''
return $_[0]; } return;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Return Question in Subroutine
by Anonymous Monk on Apr 28, 2006 at 13:44 UTC |