in reply to lvalue subs return undef, playing with experimental features, the End of the World, etc
That should certainly do the trick. If you don't care about assigning to new places, you can simplify:sub assign_to_hash : lvalue { exists($hash{$_[0]})? $hash{$_[0]} : undef; }
It's peculiar, but effective. Just be careful.sub assign_to_hash : lvalue { exists($hash{$_[0]})? $hash{$_[0]} : $hash{$_[0]} = undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: lvalue subs return undef, playing with experimental features, the End of the World, etc
by erikharrison (Deacon) on May 07, 2002 at 06:16 UTC | |
by tadman (Prior) on May 07, 2002 at 06:27 UTC | |
by demerphq (Chancellor) on May 07, 2002 at 11:40 UTC |