Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!ucsd!ucbvax!hplabs!hpcc01!hpccc!weisberg From: weisberg@hpccc.HP.COM (Len Weisberg) Newsgroups: comp.lang.perl Subject: Re: perl man page (bugs and enhancements) Message-ID: <12170011@hpccc.HP.COM> Date: 15 Aug 90 18:21:53 GMT References: <1990Aug13.194249.6156@amd.com> Organization: HP Corp Computing & Services Lines: 46 I thought I'd give Jeff first crack at clarifying his comments, but he seems to have backed down on the second one: Regarding the following from the manual: > As mentioned earlier, if any list operator (print, etc.) or > any unary operator (chdir, etc.) is followed by a left > parenthesis as the next token on the same line, the operator > and arguments within parentheses are taken to be of highest > precedence, just like a normal function call. Examples: > > chdir $foo || die; # (chdir $foo) || die > chdir($foo) || die; # (chdir $foo) || die > chdir ($foo) || die; # (chdir $foo) || die > chdir +($foo) || die; # (chdir $foo) || die > > but, because * is higher precedence than ||: > > chdir $foo * 20; # chdir ($foo * 20) > chdir($foo) * 20; # (chdir $foo) * 20 > chdir ($foo) * 20; # (chdir $foo) * 20 > chdir +($foo) * 20; # chdir ($foo * 20) Jeff wrote : Shouldn't it read: : but, because * is higher precedence than +: I agree with Larry that that misses the point. My suggestion is that it should read: but, because * has higher precedence than chdir : Larry writes: > The point is that chdir (as a > unary operator) has a precedence intermediate between || and *, so * and || > don't behave the same after chdir. This point might be further clarified by adding before the first 4 indented lines something like: Because || has lower precedence than chdir we have: ---------- Now, repeat after me: Tasteful redundancy is Golden. - Len Weisberg - HP Corp Computing & Services - weisberg@corp.HP.COM