Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 romping around the Monastery: (7)
As of 2014-12-25 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls