in reply to Re: Handling non-fatal method error strings without exceptions or globals?
in thread Handling non-fatal method error strings without exceptions or globals?
Or, you could use wantarray to eliminate the caveat...
-- All code is 100% tested and functional unless otherwise noted.
#!/usr/bin/perl -w $result = fun(); print "$result\n"; ($result, $error) = fun(); print "$result, $error\n"; sub fun { return wantarray ? ("stuff","Error") : "stuff" }
-- All code is 100% tested and functional unless otherwise noted.
|
---|
In Section
Seekers of Perl Wisdom