Author: larry Date: Sat Sep 16 17:35:31 2006 New Revision: 12136 Modified: doc/trunk/design/syn/S03.pod
Log: Documented differences to filetest ops. Modified: doc/trunk/design/syn/S03.pod ============================================================================== --- doc/trunk/design/syn/S03.pod (original) +++ doc/trunk/design/syn/S03.pod Sat Sep 16 17:35:31 2006 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 8 Mar 2004 - Last Modified: 14 Sep 2006 + Last Modified: 16 Sep 2006 Number: 3 - Version: 64 + Version: 65 =head1 Changes to Perl 5 operators @@ -35,6 +35,19 @@ "stitching" the two ends of its arguments together. String append is likewise C<~=>. +=item * The filetest operators now return a result that is both a boolean +and a stat buffer, so there is no longer any need for Perl 5's C<_> term. +Instead just cascade tests to "and" them: + + if -r -w -x $filename {...} + +Or put the value in a variable to do anything fancier: + + $sb = -e $filename; + if -r $sb {...} + if -w $sb {...} + if -x $sb {...} + =item * All postfix operators that do not start with a dot also have an alternate form that does. (The converse does not hold--just because you can write C<x().foo> doesn't mean you can write C<x()foo>. Likewise