Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: perl man page (bugs and enhancements) Message-ID: <9131@jpl-devvax.JPL.NASA.GOV> Date: 13 Aug 90 23:04:40 GMT References: <1990Aug13.194249.6156@amd.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 54 In article <1990Aug13.194249.6156@amd.com> dwork@brahms.amd.com (Jeff Dwork) writes: : Two man page bugs: : : > splice(ARRAY,OFFSET) : > : > push(@a,$x,$y) splice(@a,$#x+1,0,$x,$y) : : Shouldn't that be `$#a'? No. That would insert $x and $y before the last element. : > 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) : : Shouldn't it read: : but, because * is higher precedence than +: No, that's not what the + is doing there. The point is that chdir (as a unary operator) has a precedence intermediate between || and *, so * and || don't behave the same after chdir. : Two requests: : : The man page lists only operators that differ from those in C. Many : of our users (and potential users) do little or no C programming. How about : adding the rest of the operators to the man page? : : The section on regular expressions requires one to also read the : regexp routine documentation. Could the relevant sections of regexp(3) be : included in this section? They'll be in the book. I don't know about the man page--I'm already accused of putting too much there. And there's a fine minimalistic tradition of man pages referring to other man pages. After all, redundancy is Evil. Say that with me. Redundancy is Evil. Again. Redundancy is Evil. Again... Now if Tom would just upgrade his man program to a generalized hypertext system, we wouldn't have this problem... :-) Larry