in reply to Re^4: Elegant way to return true or nothing from a subroutine?
in thread Elegant way to return true or nothing from a subroutine?
sub foo { return undef;} sub bar { return;} if (my @foos = foo()) { print "foo() is so true...\n"; ## surprise! } else { print "foo() is false.\n" } if (my @bars = bar()) { print "bar() is true...\n"; } else { print "bar() is false.\n" }
|
|---|