Path: utzoo!mnetor!tmsoft!torsqnt!hybrid!scifi!bywater!uunet!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: Do be do be do. Message-ID: <1991Feb04.125401.29075@convex.com> Date: 4 Feb 91 12:54:01 GMT References: <121266@uunet.UU.NET> <1991Feb04.034645.3658@convex.com> <121307@uunet.UU.NET> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 34 Nntp-Posting-Host: pixel.convex.com From the keyboard of rbj@uunet.UU.NET (Root Boy Jim): :[Tom explains diff between "do sub;" != "do sub()" == "&sub()" != "&sub" do sub; is illegal. you need the parens. : function(a,r,g,s) while condition :with : &Function(a,r,g,s) while condition : :I see no reason to treat a subroutine call different from any :other expression. This is counterintuitive. I hope I haven't led you to believe that it is different. In both cases, the while gets evaluated first; that's just how statement modifiers work. Only for do { FOO } while EXPR; should the loop execute at least once (FORTRAN 66 mode :-) irrespective of the EXPR's value. because the while is NOT evaluated until the end, Otherwise people would be surprised. So these will not happen: &FOO while 0; do FOO() while 0; but this will: do { &FOO; } while 0; --tom -- "Still waiting to read alt.fan.dan-bernstein using DBWM, Dan's own AI window manager, which argues with you 10 weeks before resizing your window." ### And now for the question of the month: How do you spell relief? Answer: U=brnstnd@kramden.acf.nyu.edu; echo "/From: $U/h:j" >>~/News/KILL; expire -f $U