[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Omaha.pm] Code reduction
That would work if it had a ")". And possibly this:
next if ($row[20] !~ /^(PENDING|ACTIVE)$/);
:)
Sean
-----Original Message-----
From: omaha-pm-bounces+pbaker=omnihotels.com@pm.org
[mailto:omaha-pm-bounces+pbaker=omnihotels.com@pm.org] On Behalf Of Jay
Hannah
Sent: Thursday, May 17, 2007 2:43 PM
To: omaha-pm@pm.org
Subject: [Omaha.pm] Code reduction
Confession: This isn't really Perl specific, just a general logic /
cleanup excercise.
j
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)$/;
_______________________________________________
Omaha-pm mailing list
Omaha-pm@pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm