Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How would you rewrite this?

by larryk (Friar)
on Apr 27, 2005 at 15:22 UTC ( #451986=note: print w/ replies, xml ) Need Help??


in reply to How would you rewrite this?

hmm. the fiddle with two 3 indexes mapping to contact_id makes it kinda ugly but if the order is not important...

my %stuff = ( agency_id => 0, advertiser => 1, campaign_id => 2, admin_contact_id => 3, tech_contact_id => 3, ); get_updates( $objects[$stuff{$_}], /(contact_id)$/ ? $1 : $_, # ugh $result_ref->{$_} ) for grep $result_ref->{$_}, keys %stuff;
but personally I would add return unless $_[2]; (or whatever you shifted $_[2] into) to get_updates to remove the requirement of checking $result_ref->{$_} every time.
   larryk                                          
perl -le "s,,reverse killer,e,y,rifle,lycra,,print"


Comment on Re: How would you rewrite this?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (16)
As of 2014-12-19 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (75 votes), past polls