[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Code reduction



On Thu, 17 May 2007, Jay Hannah wrote:
Before:

next if ((not $row[20] =~ /^PENDING/) and (not $row[20] =~ /^ACTIVE/)); #get rid of all rows not pending
# next if (not $row[20] =~ /^PENDING/); #get rid of all rows not pending
next if ($row[19] =~ /^ON-CALL/);

After:

next unless ($row[20] =~ /^(PENDING|ACTIVE)$/;

Whoops! $row[20] and $row[19] are not the same thing. Doh!

After(v2):

next unless ($row[20] =~ /^(PENDING|ACTIVE)$/;
next if ($row[19] =~ /^ON-CALL/);

Somebody slap me!

j