Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to localize conditionally?

by Corion (Pope)
on Mar 13, 2011 at 20:00 UTC ( #892988=note: print w/replies, xml ) Need Help??


in reply to How to localize conditionally?

You could use goto or the blockless version of if:

local $ENV{BLAH} = 42 if $DO_MAGIC; libcall();

or

goto LIBCALL if (! $DO_MAGIC); local $ENV{BLAH} = 42; LIBCALL: libcall();

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2020-07-13 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?