Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Simplifying repeated parameter lists

by Perlbotics (Canon)
on Sep 19, 2012 at 20:05 UTC ( #994520=note: print w/ replies, xml ) Need Help??


in reply to Simplifying repeated parameter lists

TIMTOWTDI:

submit_thingamabob( $handle, $not_today, $thingie, $_->[0], $_->[1]) for ( [ "Foo!" , 234 ], [ "Frob!", 23 ], [ "Forb!", 54 ], [ "ooF!", 11 ], [ "broF!", fakenum ], [ "Frap!", 458 ] );


Comment on Re: Simplifying repeated parameter lists
Download Code
Replies are listed 'Best First'.
Re^2: Simplifying repeated parameter lists
by Voronich (Hermit) on Sep 19, 2012 at 20:16 UTC

    As much as I liked the hippo/BrowserUk solution, I think this appeals to me the most.

    It wraps the fundamentally iterative nature of what I'm doing without adding the slightest bit of unnecessary complexity.

Re^2: Simplifying repeated parameter lists
by GrandFather (Sage) on Sep 20, 2012 at 23:51 UTC

    or somewhat tidier:

    submit_thingamabob($handle, $not_today, $thingie, @$_) for [Foo => 234], [Frob => 23], [Forb => 54], [ooF => 11], [Frap = +> 458];
    True laziness is hard work

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-28 09:00 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 (254 votes), past polls