home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!netsys!news.cerf.net!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Subject: Re: bug with "last"
- Message-ID: <1993Jan11.223716.18722@netlabs.com>
- Sender: news@netlabs.com
- Nntp-Posting-Host: scalpel.netlabs.com
- Organization: NetLabs, Inc.
- References: <cameron-930111155241-1-06364@fuligin>
- Date: Mon, 11 Jan 1993 22:37:16 GMT
- Lines: 18
-
- In article <cameron-930111155241-1-06364@fuligin> cameron@cs.unsw.oz.au writes:
- : This loop runs three times.
- :
- : for (('a','b','c'))
- : { print "\$_ is '$_'\n";
- : { last; }
- : }
- :
- : Surely it shouldn't? This is perl 4.035.
-
- Remember that a bare block like
-
- { last; }
-
- is defined to be a loop that executes once. Since "last" exits
- the innermost loop, that's the block that it exits.
-
- Larry
-