Path: utzoo!attcan!uunet!husc6!mailrus!iuvax!pur-ee!a.cs.uiuc.edu!uxc.cso.uiuc.edu!uicsrd.csrd.uiuc.edu!mcdaniel From: mcdaniel@uicsrd.csrd.uiuc.edu Newsgroups: comp.sources.d Subject: Re: Perl question: what do {{ and }} me Message-ID: <42400007@uicsrd.csrd.uiuc.edu> Date: 30 Jun 88 19:11:00 GMT References: <335@rhesus.primate.wisc.edu> Lines: 43 Nf-ID: #R:rhesus.primate.wisc.edu:335:uicsrd.csrd.uiuc.edu:42400007:000:1657 Nf-From: uicsrd.csrd.uiuc.edu!mcdaniel Jun 30 14:11:00 1988 /* Written 4:22 pm Jun 29, 1988 by bin@rhesus.primate.wisc.edu in uicsrd.csrd.uiuc.edu:comp.sources.d */ > The perl 2.0 manual contains two examples that use {{ and }} > instead of { and } to bracket subroutines. One of them says > to note the double curly brackets. But what do they mean? > The explanation is not in the manual, or at least I can't > find it. 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 > Yours, > Paul DuBois Best regards to Blanche, then. :-) -- Tim, the Bizarre and Oddly-Dressed Enchanter Center for Supercomputing Research and Development at the University of Illinois at Urbana-Champaign Internet, BITNET: mcdaniel@uicsrd.csrd.uiuc.edu UUCP: {ihnp4,uunet,convex}!uiucuxc!uicsrd!mcdaniel ARPANET: mcdaniel%uicsrd@uxc.cso.uiuc.edu CSNET: mcdaniel%uicsrd@uiuc.csnet