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.
In Section
Meditations