Path: utzoo!attcan!uunet!cbmvax!schmid From: schmid@spica.cbmvax (Bob Schmid) Newsgroups: comp.lang.perl Subject: Bug in pl28 on regexp test? Message-ID: <14496@cbmvax.commodore.com> Date: 17 Sep 90 21:12:16 GMT Sender: news@cbmvax.commodore.com Distribution: comp.lang.perl Organization: /user/schmid/.organization Lines: 54 I may have uncovered a bug in perl pl28 that did not exist in perl pl18 for the same test case, so I have gone back to pl18. The problem seems to be caused by perl thinking ($Flds[0] =~ /^[0-9]+$/) is 1, even though $Flds[0] does not contain any numeric characters (is null, actually). The code fragment that does the regexp test is: elsif (($netsection == 1) && ($Flds[0] =~ /^[0-9]+$/)) { print $whatever; } A sample db session is as follows for pl28. Again, the code works correctly for pl18, but not pl28. > Loading custom DB from perldb.pl 3.0.1.3 90/08/09 > > Enter h for help. > > ................ > ..other stuff... > ................ > > DB<2> p $Flds[0] > > DB<3> p ">$Flds[0]<" > p ">$Flds[0]<" > >< > DB<4> p ($Flds[0] =~ /^[0-9]+$/) > 1 > DB<5> Thanks, -Bob ------------------------------------------------------ R. Schmid tel# 215-431-9100 x9885 fax# 215-431-9156 VLSI Design Commodore Technology 1200 Wilson Drive West Chester, PA 19380 ------------------------------------------------------