[Omaha.pm] shorter is gooder

Jay Hannah jhannah at mutationgrid.com
Tue Sep 21 15:56:58 PDT 2010


On Sep 21, 2010, at 4:23 PM, Dan Linder wrote:
> Are those the same?  The first "/ZUPSUITE/" could find it anywhere in the line, but the second one forces it to be at the beginning of the line, correct?
> 
> (Though if your data won't have "ANOTHERZUPSUITE", then this isn't a problem...)

Indeed. Good catch. In my real application "ZUPSUITE" was abandoned in favor of "must start with Z, cannot start with ZUP_", so my real code is fine with the ^ in front.

   next if (!$packageCode or $packageCode =~ /^([^Z]|ZUP_)/);

Thanks,

Jay Hannah
Software Architect
jhannah at mutationgrid.com | http://mutationgrid.com | 1-402-598-7782







More information about the Omaha-pm mailing list