[Omaha.pm] Code reduction
Jay Hannah
jay at jays.net
Thu May 17 12:58:31 PDT 2007
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
More information about the Omaha-pm
mailing list