Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!ig!agate!eos!ames!elroy!devvax!lwall From: lwall@devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.sources.d Subject: Re: Perl question: what do {{ and }} me Message-ID: <2413@devvax.JPL.NASA.GOV> Date: 8 Jul 88 22:18:02 GMT References: <335@rhesus.primate.wisc.edu> <42400007@uicsrd.csrd.uiuc.edu> Reply-To: lwall@devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA. Lines: 26 In article <42400007@uicsrd.csrd.uiuc.edu> mcdaniel@uicsrd.csrd.uiuc.edu writes: : One example is at the end of ``Compound statements'', just before : ``Simple statements'' (page 9 in my copy). See the preceding text: : : The BLOCK by itself (labeled ot not) is equivalent to a loop : that executes once. Thus you can use any of the loop control : statements in it to leave or restart the block. . . . It's : also nice for exiting subroutines early. Note the double : curly brackets: . . . : : In ``Subroutines'' (page 28), it says that the syntax of ``sub'' is: : sub NAME BLOCK : : My interpretation is that a ``sub'' block isn't a ``proper'' block, in : that you can't do a ``last'' to break out of it. You can, however, : break out of a normal block. Thus, in ``{{ . . . }}'' in this : example, the outer braces are for ``sub'', and the inner braces are : so that the ``last'' works. The other example, under the description : of ``open'' (page 20), also notes : last; # note block inside sub Just to confuse things thoroughly, I've decided to add a return statement. It'll show up in patch2. Turned out to be fairly trivial to add, without penalizing subroutines that don't use it. Larry