home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!umn.edu!sctc.com!scott
- From: scott@sctc.com (Scott Hammond)
- Subject: function returning array cause of core dump?
- Message-ID: <1992Dec17.041247.27402@sctc.com>
- Organization: SCTC
- Date: Thu, 17 Dec 1992 04:12:47 GMT
- Lines: 40
-
- Using:
- $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
- Patch level: 35
-
- The following script dumps core on a sun4 under sunos4.1.2
-
- #!/usr/local/bin/perl
-
- sub getrevid {
- print "getrevid\n";
- (0, "name", "3.1");
- }
- sub trythis
- {
- local($ok, $nm, $version);
-
- if ($cnt==3){ exit(1); }
- print "cnt= $cnt\n";
-
- # one
- ($ok, $nm, $version)= &getrevid("");
- $cnt++;
- # two
- &trythis
- }
-
- print "res: @res\n";
-
- $cnt=0;
- &trythis
-
-
- If I comment out the line following "one" or the line following "two",
- the program will not dump core, so clearly it has something to do with
- functions returning arrays within recursive functions. Am I trying to
- do something illegal?
-
- --
- Scott Hammond
- scott@sctc.com
-