🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #206

Perl V3 bug: repeated tests

#206
From: Dennis Cottel
Date: Wed, 25 Oct 1989 23:25
27 lines
1178 bytes
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 ;-).

	Dennis Cottel  Naval Ocean Systems Center, San Diego, CA  92152
	(619) 553-1645      dennis@nosc.MIL      sdcsvax!noscvax!dennis
Technical Details
Message-ID: <1452@nosc.NOSC.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!helios.ee.lbl.gov!nosc!dennis@nosc.mil

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!helios.ee.lbl.gov!nosc!dennis@nosc.mil
From: dennis@nosc.mil (Dennis Cottel)
Newsgroups: comp.sources.bugs
Subject: Perl V3 bug: repeated tests
Message-ID: <1452@nosc.NOSC.MIL>
Date: 25 Oct 89 23:25:05 GMT
Sender: nobody@nosc.NOSC.MIL
Reply-To: dennis@nosc.mil (Dennis Cottel)
Organization: Naval Ocean Systems Center, San Diego
Lines: 27