Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Do be do be do. Message-ID: <11295@jpl-devvax.JPL.NASA.GOV> Date: 4 Feb 91 18:56:32 GMT References: <1991Feb4.012916.7944@uvaarpa.Virginia.EDU> <1991Feb04.015138.28575@convex.com> <121266@uunet.UU.NET> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 25 In article <121266@uunet.UU.NET> rbj@uunet.UU.NET (Root Boy Jim) writes: : In article <1991Feb04.015138.28575@convex.com> tchrist@convex.COM (Tom Christiansen) writes: : >It's in the section entitled ``Simple Statements'' in both the man page : >and the Camel Book (see the top of page 94). The essential text follows: : > : > The loop conditional is evaluation before the expression, except when : > applied to a do-BLOCK or a do_SUBROUTINE command, in which case the : > block executes once before the conditional is evaluated. : : Yeah, but it's not a "do SUBROUTINE", it's a "&SUBROUTINE". : Oh. They're the same thing? I don't think they should be. Neither do I. This is something I've known about for several months (my brother-in-law Mark Biggar pointed it out when he was writing the big* packages), but I hadn't had a chance to fix it. In 4.0, do foo() while $something; will always execute at least once, and &foo() while $something may execute 0 times. Larry