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

Re^2: Rethrowing with die $@ considered harmful

by xmath (Hermit)
on Jul 22, 2006 at 10:44 UTC ( #562995=note: print w/ replies, xml ) Need Help??


in reply to Re: Rethrowing with die $@ considered harmful (local $_ buggy)
in thread Rethrowing with die $@ considered harmful

Another alternative: The local of Data::Alias does it right (it ignores ties and such), so this works:

alias(local $_) = @_ ? $_[0] : $_;

And it avoids localizing the entire *_

The parens here are needed because alias local $_ = ... would be parsed as alias(local $_ = ...) which means the assignment would make an alias, which isn't what you want here.


Comment on Re^2: Rethrowing with die $@ considered harmful
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2015-07-29 10:07 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 (263 votes), past polls