home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5495 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.0 KB  |  47 lines

  1. Path: sparky!uunet!gatech!darwin.sura.net!jvnc.net!rutgers!cmcl2!psinntp!psinntp!bnlux1.bnl.gov!maeva.ccd.bnl.gov!gc
  2. From: gc@bnl.gov (Graham Campbell)
  3. Newsgroups: comp.lang.perl
  4. Subject: SEGV in perl
  5. Message-ID: <1992Aug25.185319.2532@bnlux1.bnl.gov>
  6. Date: 25 Aug 92 18:53:19 GMT
  7. Sender: news@bnlux1.bnl.gov (Usenet news)
  8. Reply-To: gc@bnl.gov
  9. Organization: Brookhaven National Laboratory
  10. Lines: 35
  11.  
  12. Why do beginners (like me) always cause trouble?
  13.  
  14. The following perl script causes perl to core dump with a SEGV on a Sun
  15. running SunOS 4.1:
  16.  
  17. #!/bin/sh --  # wish i were perl
  18. # set -vx
  19. eval 'exec perl -d -S $0 ${1+"$@"}'
  20.     if $running_under_some_useless_shell;
  21. while (($key,$value) = each %ENV){
  22.     print "$key";
  23.     if ($key =~ /WAVE_.*/){
  24.         delete $ENV{$key};
  25.         print " deleted";
  26.     };
  27.     print "\n";
  28. };
  29. print "\nRecapitulating\n";
  30. while (($key,$value) = each %ENV){
  31.     print "$key\n";
  32. }
  33.  
  34. And "perl -v" says:
  35.  
  36. This is perl, version 4.0
  37.  
  38. $RCSfile: perl.c,v $$Revision: 4.0.1.6 $$Date: 91/11/11 16:38:45 $
  39. Patch level: 19
  40.  
  41. Can anyone enlighten me?
  42.  
  43. Graham
  44. ---
  45. Graham
  46. gc@bnl.gov
  47.