Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!ames!pasteur!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: bug in pl41 (FYI) Message-ID: <1990Dec5.202821.246@iwarp.intel.com> Date: 5 Dec 90 20:28:21 GMT Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 65 Found this bug while working on the index in pl41... ################################################## perl -pe 's/ /\\0/g,s/\\0/ / if /^\.XX/' <<\EOF .XX integers,\0large,\0manipulating Input values may be of the form $FNUM = fneg($FNUM); # negation The routine returns the number of warnings issued. EOF ################################################## The third line should not be touched, but is incorrectly altered to read: $FNUM = fneg($FNUM); # negattio This is very wrong. Larry has already recieved this bug report in private mail. Perl pl28 worked fine on this. Interestingly enough, deleting *any* of the four lines makes it go away (including the *following* line). This one's weird. By the way, after initially noting the bug, but noticing that just feeding a bad line wouldn't trigger it, I had to reduce the "trigger" set down to something manageable. I did it with the following quickly written test harness, which you may find interesting: ################################################## #!/local/usr/bin/perl open(B,"book.B") || die; @B = ; close(B); while (++$n < 10) { @copy = @B; print "deleting one line of ", 0+@copy, " lines\n"; splice(@copy, rand($#copy), 1); # deletes it open(T,">T") || die; print T @copy; close(T); $ret = system <<'EOF';; perl -pe 's/ /\\0/g,s/\\0/ / if /^\.XX/;' T >TT; diff T TT EOF if ($ret) { @B = @copy; $n = 0; } } print "minimal set:\n", @B; exit 0; ################################################## Yes, book.B is appendix B of "the book". So look here, you get four lines of the book for free. :-) The algorithm starts with the whole chapter, and deletes one line at a time at random until it can't delete any more. It found the minimal set pretty fast. (The diff was for my benefit... for silent operation, I would have replaced it with cmp). print "Just another [puzzled] Perl hacker," -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/ Brought to you by Super Global Mega Corp .com