Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by cLive ;-) (Prior)
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 ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://92478]
help
Chatterbox?
[chacham]: i'm reading an article on codepath.com and thee is a disturbing message on the bottom right that says, "Fork me on GitHub". Maybe i just have a dirty mind.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2017-08-17 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (287 votes). Check out past polls.

    Notices?