in reply to lvalue subs return undef, playing with experimental features, the End of the World, etc
Seems to work here, what version of perl are you using and how are you calling the sub? Here's a version abridged for the command line:
This is Perl 5.6.1.$ perl -Mstrict -we'{my %hsh;sub set:lvalue{$hsh{shift}}}my $baz=set(" +foo")="bar"; print $baz,$/,set("foo"),$/' bar bar $
Update: Changing the oneliner to be more like yours, I get:
which is what I'd expect. Recent AS should be fine.$ perl -Mstrict -we'{my %hsh;sub set:lvalue{$hsh{shift}}}my $baz=set(" +foo")=([qw/bar baz/]); print $baz,$/,defined set("foo"),$/' ARRAY(0x8106284) 1 $
U 2 : ++tadman for the solution, well spotted!
After Compline,
Zaxo
|
|---|
| 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:08 UTC |