http://qs321.pair.com?node_id=423435


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...
#!/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.