home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!sgi!wdl1!wdl39!mab
- From: mab@wdl39.wdl.loral.com (Mark A Biggar)
- Newsgroups: comp.lang.perl
- Subject: Re: bug with "last"
- Message-ID: <1993Jan11.223151.4786@wdl.loral.com>
- Date: 11 Jan 93 22:31:51 GMT
- References: <cameron-930111155241-1-06364@fuligin> <1993Jan11.175416.3503@netcom.com>
- Sender: news@wdl.loral.com
- Organization: Loral Western Development Labs
- Lines: 20
-
- In article <1993Jan11.175416.3503@netcom.com> lgolding@netcom.com (Laurence J. Golding) writes:
- > ... If the LABEL is omitted, the loop control statement refers to
- > the innermost enclosing loop.
- >Now, in your example, the "{last;}" certainly does not look like a loop,
- >and the "for" certainly does look like the innermost enclosing loop. So it
- >appears that the book should read:
- > ... If the LABEL is ommitted, the loop control statement refers to
- > the innermost enclosing _block_.
-
- This rule doesn't work because last ignores BLOCKS that are branches of
- if statements and the BLOCK in a do {...} expression. As the book and man
- page say a unadorned BLOCK is equivalent to a do-it-once loop. Now you
- might get away with saying "the innermost BLOCK that is the body of a loop"
- but that would get confused with my last does not work with do {...} while();
- So, I guess the best thing is to just leave it alone.
-
- --
- Perl's Maternal Uncle
- Mark Biggar
- mab@wdl1.wdl.loral.com
-