home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / perl / 7627 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.4 KB  |  37 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: Bug with foreach/local in 4.035
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Dec29.224047.20472@news.eng.convex.com>
  8. Date: Tue, 29 Dec 1992 22:40:47 GMT
  9. Distribution: comp
  10. Reply-To: tchrist@convex.COM (Tom Christiansen)
  11. References: <SOUP.92Dec28105043@ampersand.ampersand.com>
  12. Nntp-Posting-Host: pixel.convex.com
  13. Organization: Convex Computer Corporation, Colorado Springs, CO
  14. X-Disclaimer: This message was written by a user at CONVEX Computer
  15.               Corp. The opinions expressed are those of the user and
  16.               not necessarily those of CONVEX.
  17. Lines: 18
  18.  
  19. From the keyboard of soup@ampersand.com (Doug Campbell):
  20. :There appears to be a bug (or at least a surprising behavior) in 4.035
  21. :regarding foreach and local.  It seems that a construct like:
  22. :
  23. :    foreach $i (@list)
  24. :
  25. :will  cause a subsequent (down the call stack) "local ($i)" to cause the
  26. :item  in  @list  currently  referenced  by $i  to appear  blank.   
  27.  
  28. That's a manifestation of "variable suicide".  You can read about it 
  29. in the FAQ.
  30.  
  31. --tom
  32. -- 
  33.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  34.  
  35.     stab_val(stab)->str_nok = 1;    /* what a wonderful hack! */
  36.         --Larry Wall in stab.c from the perl source code
  37.