home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / perl / 7760 < prev    next >
Encoding:
Text File  |  1993-01-11  |  821 b   |  31 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!netsys!news.cerf.net!netlabs!lwall
  3. From: lwall@netlabs.com (Larry Wall)
  4. Subject: Re: bug with "last"
  5. Message-ID: <1993Jan11.223716.18722@netlabs.com>
  6. Sender: news@netlabs.com
  7. Nntp-Posting-Host: scalpel.netlabs.com
  8. Organization: NetLabs, Inc.
  9. References: <cameron-930111155241-1-06364@fuligin>
  10. Date: Mon, 11 Jan 1993 22:37:16 GMT
  11. Lines: 18
  12.  
  13. In article <cameron-930111155241-1-06364@fuligin> cameron@cs.unsw.oz.au writes:
  14. : This loop runs three times.
  15. :     for (('a','b','c'))
  16. :         { print "\$_ is '$_'\n";
  17. :           { last; }
  18. :         }
  19. : Surely it shouldn't? This is perl 4.035.
  20.  
  21. Remember that a bare block like
  22.  
  23.     { last; }
  24.  
  25. is defined to be a loop that executes once.  Since "last" exits
  26. the innermost loop, that's the block that it exits.
  27.  
  28. Larry
  29.