home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / perl / 7787 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.0 KB

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!ames!pacbell.com!charon.amdahl.com!netcomsv!mama!simpson
  2. From: iac!simpson@uunet.uu.net (Scott Simpson)
  3. Newsgroups: comp.lang.perl
  4. Subject: Bug in perl. Infinite loop on EOF.
  5. Summary: Perl goes in an infinite loop on EOF.
  6. Keywords: infinite loop, end of file
  7. Message-ID: <913@iac.uunet.uu.net>
  8. Date: 12 Jan 93 23:55:03 GMT
  9. Reply-To: iac!simpson@uunet.uu.net
  10. Organization: Investment Technology Group, Culver City, CA
  11. Lines: 28
  12.  
  13.  
  14. This is perl, version 4.0
  15.  
  16. $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
  17. Patch level: 33
  18.  
  19. I have the following script:
  20.  
  21. #! /usr/lbin/perl
  22. while (<>) {
  23.     chop;
  24.     if ($line2 = <>) {
  25.     if ($line3 = <>) {
  26.         ;
  27.     }
  28.     }
  29. }
  30.  
  31. and the following data file:
  32.  
  33. line1
  34. line2
  35.  
  36. When I run the script on the file, perl goes in an infinite loop. If I
  37. run it in the debugger, the debugger goes in an infinite loop on the
  38. inner loop statement.
  39. -- 
  40. Scott Simpson, Investment Technology Group, iac!simpson@uunet.uu.net
  41.