Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 contemplating the Monastery: (7)
As of 2014-08-29 13:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls