Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Bulk Hash Assignment

by premchai21 (Curate)
on Apr 17, 2002 at 17:07 UTC ( #159900=note: print w/ replies, xml ) Need Help??


in reply to Bulk Hash Assignment

YAWTDI -- you could use an anonymous function...

sub { for(map{$_*2} 0..$#_/2) { $bfb->{$_[$_+1]} = $ofb{$_[$_]} }}->(q +w[camshaft camshaft ...]);

Or, alternatively:

sub { my%g=@_; for(keys%g) { $bfb->{$g{$_}} = $ofb{$_} }}->(qw[camshaf +t camshaft ...]);


Comment on Re: Bulk Hash Assignment
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://159900]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2015-07-30 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls