Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to make bi-modal variables like $! ?

by cLive ;-) (Parson)
on Jun 29, 2001 at 01:41 UTC ( #92478=note: print w/ replies, xml ) Need Help??


in reply to How to make bi-modal variables like $! ?

Cheat - use @err and force context :)

my @err = build_error("Something went wrong",5); print "The error message is: @err\n"; print "The error number is: ".@err."\n"; exit(0); sub build_error { my @err; $err[0] = $_[0]; int($_[1]); $err[$_[1]-1] = '' if ($_[1]-1 > 0); return @err; }
cLive ;-)


Comment on Re: How to make bi-modal variables like $! ?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://92478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (20)
As of 2015-07-01 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (3 votes), past polls