in reply to Simplifying repeated parameter lists

Voronich:

Take advantage of list flattening:

{ # new scope so we don't blow up another @t my @t = ($handle, $not_today, $thingie); submit_thingamabob(@t, "Foo!", 234); submit_thingamabob(@t, "Frob!",23); submit_thingamabob(@t, "Forb!",54); submit_thingamabob(@t, "ooF!",11); submit_thingamabob(@t, "broF!",fakenum); submit_thingamabob(@t, "Frap!",458); }

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Simplifying repeated parameter lists
by Voronich (Hermit) on Sep 19, 2012 at 19:52 UTC
    I'm... retarded. Thanks robo o/

      Go one step further:

      sub x { return submit_thingamabob( $handle, $not_today, $thingie, @_ }; } x( "Foo!", 234 ); x( "Frob!", 23 ); x( "Forb!", 54 ); x( "ooF!", 11 ); x( "broF!", fakenum ); x( "Frap!", 458 );

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong