Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Bulk Hash Assignment

by Fletch (Chancellor)
on Apr 17, 2002 at 12:55 UTC ( #159781=note: print w/ replies, xml ) Need Help??


in reply to Bulk Hash Assignment

schlep(\%other_foo_bucket => $big_foo_bucket, qw[ camshaft camshaft gearbox1 gearbox the_drivetrain drivetrain my_smokestack smokestack _junkyard junkyard ]);

Rather than qw[] you could use a heredoc and have your routine do the splitting. Then you could have:

schlep(\%other_foo_bucket => $big_foo_bucket, <<EOT ); camshaft camshaft gearbox1 gearbox the_drivetrain drivetrain my_smokestack smokestack _junkyard junkyard EOT

I want to say this is mentioned somewhere in the camel, maybe not for this exact problem but for something similar.


Comment on Re: Bulk Hash Assignment
Select or Download Code
Re^2: Bulk Hash Assignment
by tadman (Prior) on Apr 17, 2002 at 20:38 UTC
    Certainly, that is easy from an input perspective, but if one were to have a mapping already prepared, you'd have to convert it into a string before using it. Yuck. qw, despite how ugly it can look, sure works well.

    Still, using here-doc style declarations for function params is a very interesting idea.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-09-22 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (185 votes), past polls