home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5860 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.2 KB  |  42 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!yktnews!victor
  3. From: victor@watson.ibm.com (Victor Miller)
  4. Subject: perl dumps core on long regular expressions.
  5. Sender: news@watson.ibm.com (NNTP News Poster)
  6. Message-ID: <VICTOR.92Sep11094204@terse4.watson.ibm.com>
  7. Date: Fri, 11 Sep 1992 13:42:04 GMT
  8. Reply-To: victor@watson.ibm.com
  9. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  10. Nntp-Posting-Host: terse4.watson.ibm.com
  11. Organization: IBM, T.J. Watson Research Center
  12. Lines: 28
  13.  
  14. I've tried the following script on perl 4.010 on an RS/6000, sun
  15. sparcstation and IBM RT/PC.  If you call this script bug, then
  16. bug n
  17.  
  18. where n is any number 30 or bigger dumps core, but an smaller value
  19. terminates normally.  The local administrators haven't upgraded to
  20. 4.035 yet, so I can't test it on that.
  21.  
  22. #!/usr/bin/perl
  23. $n = shift;
  24. $n = 25 if $n eq "";
  25. for $i (0..$n) {
  26.     push(@files,sprintf("%3d",$i));
  27. }
  28.      
  29. $re = '^(' . join("|", @files) .  ')+$' ;
  30.  
  31. @a = ('a','AAA','AAAS');
  32. foreach (@a) {
  33.     $len{$_} = length if /$re/io;
  34. }
  35.  
  36. --
  37.         Victor S. Miller
  38.         Bitnet: VICTOR at WATSON
  39.         Internet: victor@watson.ibm.com
  40.         IBM, TJ Watson Research Center
  41.         "Great artists steal; lesser artists borrow" Igor Stravinsky
  42.