in reply to Re: Experimenting with Lvalue Subs
in thread Experimenting with Lvalue Subs
Not sure if that was the original behavior back in 1999 when they were first introduced but newer versions certainly disagree with you:
...You can retrieve it with $foo->get_set($bad_key)my %foo; get_set( 'foo' ) = 42; print get_set( 'foo' ); sub get_set :lvalue { my $key = shift; print "key is $key\n"; my $junk; $key eq 'foo' ? $foo{$key} : $junk; } __END__ key is foo key is foo 42
Where $bad_key is any and all bad keys. This is why one of the desired features would be to determine if it was in assignment or not.
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Experimenting with Lvalue Subs
by Zaxo (Archbishop) on Jan 24, 2005 at 20:31 UTC |