Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 chilling in the Monastery: (5)
As of 2014-11-23 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls