Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> which pulls the values at the named keys out of arg_map into vars named after the respective keys
That's kind of a hash slice but in a DRY way to avoid typing and typos??? my ($foo, $bar) = @arg_map{qw/foo bar/} ? Sure I can, but I'd need another command and would have a dependency to PadWalker. (Probably) Something like set_key(my($foo, $bar)) would just return° the needed pairs from the solution in the OP
Edit°) That is the equivalent to { foo => set my $foo , bar => set my $bar }
Cheers Rolf In reply to Re^2: RFC: Destructuring Assignment (aka Unpacking aka Type Patterns) in pure Perl
by LanX
|
|