in reply to How would you rewrite this?

Do you want to test $result_ref->{'agency_id'} is non-zero for all all the calls? That looks to me like a typo, since you first test for the "defined-ness" of other unrelated values. If it is not a typo, you could simplify the appearance of your code by putting everyting inside an if-statement conditional on that test.

if ( defined $result_ref->{agency_id} and $result_ref->{agency_id} ) +{ get_updates($objects[0], 'agency_id', $result_ref->{'agency_id'}); get_updates($objects[1], 'advertiser', $result_ref->{'advertiser'}) if defined $result_ref->{'advertiser'}; get_updates($objects[2], 'campaign_id', $result_ref->{'campaign_id'} +) if defined $result_ref->{'campaign_id'}; get_updates($objects[3], 'contact_id', $result_ref->{'admin_contact_ +id'}) if defined $result_ref->{'admin_contact_id'}; get_updates($objects[3], 'contact_id', $result_ref->{'tech_contact_i +d'}) if defined $result_ref->{'tech_contact_id'}; );

the lowliest monk

Replies are listed 'Best First'.
Re^2: How would you rewrite this?
by jacques (Priest) on Apr 27, 2005 at 01:30 UTC
    You discovered the typo. Yes, agency_id should not be in every if statement. That was a copy/paste error when I was writing the code. So rewriting it the way you did would not be right.