in reply to Re^6: Perl Idioms Explained - keys %{{map{$_=>1}@list}}
in thread Perl Idioms Explained - keys %{{map{$_=>1}@list}}
I would not have expected #3's behavior. Would you? I think it merits an "undef is not a listop" warning. The correct way to undef the values is: @h{qw|a b c|} = ();
The correct way to autovivify them but leave them unmodified if they already exist is () = \@h{qw(a b c)};
Caution: Contents may have been coded under pressure.
Caution: Contents may have been coded under pressure.
|
---|
In Section
Meditations