[Omaha.pm] Code reduction

Sean Baker pbaker at omnihotels.com
Thu May 17 12:04:08 PDT 2007


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 at pm.org
[mailto:omaha-pm-bounces+pbaker=omnihotels.com at pm.org] On Behalf Of Jay
Hannah
Sent: Thursday, May 17, 2007 2:43 PM
To: omaha-pm at 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 at pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm



More information about the Omaha-pm mailing list