Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Handling non-fatal method error strings without exceptions or globals?

by sleepingsquirrel (Hermit)
on Jan 19, 2005 at 16:51 UTC ( #423435=note: print w/replies, xml ) Need Help??


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.
  • Comment on Re^2: Handling non-fatal method error strings without exceptions or globals?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://423435]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-10-22 01:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (271 votes). Check out past polls.

    Notices?