🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #210

Re: Perl V3 bug: repeated tests

#210
From: Larry Wall
Date: Fri, 27 Oct 1989 01:44
34 lines
1533 bytes
In article <1452@nosc.NOSC.MIL> dennis@nosc.mil (Dennis Cottel) writes:
: There's a bug in Perl3.0, related, I think, to the new optimization
: for repeated tests on the same variable.  Things quit working in
: mysterious ways if you have a construction like:
: 
: 	if ( $i = 1 ) {...}
: 	if ( $i = 2 ) {...}
: 	if ( $i = 3 ) {...}
: 	if ( $i = 4 ) {...}
: 	...
: 
: This breaks if you have 3 or more tests.  You can get around the
: problem by doing something like:
: 
: 	if ( $i = 1 ) {...}
: 	if ( $i = 2 ) {...}
: $kludge++;
: 	if ( $i = 3 ) {...}
: 	if ( $i = 4 ) {...}
: 	...
: 
: to avoid having more than 2 tests in a row.
: 
: I have reported this to Larry Wall (actually to Larry's mail handling
: program ;-).

This is fixed in my version.  Patch #1, coming out later tonight, will
correct this problem, among others.

How come this didn't show up in alpha, beta or gamma testing?  Life is
disgusting.  ('Course, so is the alternative.)

Larry Wall
lwall@jpl-devvax.jpl.nasa.gov
Technical Details
Message-ID: <6325@jpl-devvax.JPL.NASA.GOV>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jpl-devvax!lwall
References: <1452@nosc.NOSC.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jpl-devvax!lwall
From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Newsgroups: comp.sources.bugs
Subject: Re: Perl V3 bug: repeated tests
Message-ID: <6325@jpl-devvax.JPL.NASA.GOV>
Date: 27 Oct 89 01:44:07 GMT
References: <1452@nosc.NOSC.MIL>
Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Organization: Jet Propulsion Laboratory, Pasadena, CA
Lines: 34