home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7477 < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.1 KB  |  50 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!umn.edu!sctc.com!scott
  3. From: scott@sctc.com (Scott Hammond)
  4. Subject: function returning array cause of core dump?
  5. Message-ID: <1992Dec17.041247.27402@sctc.com>
  6. Organization: SCTC
  7. Date: Thu, 17 Dec 1992 04:12:47 GMT
  8. Lines: 40
  9.  
  10. Using:
  11.     $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
  12.     Patch level: 35
  13.  
  14. The following script dumps core on a sun4 under sunos4.1.2
  15.  
  16.     #!/usr/local/bin/perl
  17.  
  18.     sub getrevid {
  19.     print "getrevid\n";
  20.     (0, "name", "3.1");
  21.     }
  22.     sub trythis
  23.     {
  24.     local($ok, $nm, $version);
  25.  
  26.     if ($cnt==3){ exit(1); }
  27.     print "cnt= $cnt\n";
  28.  
  29.     # one
  30.     ($ok, $nm, $version)= &getrevid("");
  31.     $cnt++;
  32.     # two
  33.     &trythis
  34.     }
  35.  
  36.     print "res: @res\n";
  37.  
  38.     $cnt=0;
  39.     &trythis
  40.  
  41.  
  42. If I comment out the line following "one" or the line following "two",
  43. the program will not dump core, so clearly it has something to do with
  44. functions returning arrays within recursive functions.  Am I trying to
  45. do something illegal? 
  46.  
  47. --
  48. Scott Hammond
  49. scott@sctc.com
  50.