IIRC Perl 6 will provide this syntax (as well as the less
backwards-compatible C<-fwx $file> combination, which I don't
think is suitable for Perl 5.)
The patch provides concise docs and tests, but no perldelta.pod
patch. I think it's suitable for 5.8.2.
Comments ?
Index: doio.c
===================================================================
--- doio.c (revision 2678)
+++ doio.c (working copy)
@@ -1338,6 +1338,9 @@ Perl_my_stat(pTHX)
return (PL_laststatval = -1);
}
}
+ else if (PL_op->op_private & OPpFT_STACKED) {
+ return PL_laststatval;
+ }
else {
SV* sv = POPs;
char *s;
@@ -1364,6 +1367,8 @@ Perl_my_stat(pTHX)
}
}
+static char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat";
+
I32
Perl_my_lstat(pTHX)
{
@@ -1374,7 +1379,7 @@ Perl_my_lstat(pTHX)
EXTEND(SP,1);
if (cGVOP_gv == PL_defgv) {
if (PL_laststype != OP_LSTAT)
- Perl_croak(aTHX_ "The stat preceding -l _ wasn't an lstat");
+ Perl_croak(aTHX_ no_prev_lstat);
return PL_laststatval;
}
if (ckWARN(WARN_IO)) {
@@ -1383,6 +1388,9 @@ Perl_my_lstat(pTHX)
return (PL_laststatval = -1);
}
}
+ else if (ckWARN(WARN_IO) && PL_laststype != OP_LSTAT
+ && (PL_op->op_private & OPpFT_STACKED))
+ Perl_croak(aTHX_ no_prev_lstat);
PL_laststype = OP_LSTAT;
PL_statgv = Nullgv;
Index: pod/perlfunc.pod
===================================================================
--- pod/perlfunc.pod (revision 2678)
+++ pod/perlfunc.pod (working copy)
@@ -366,6 +366,9 @@ Example:
print "Text\n" if -T _;
print "Binary\n" if -B _;
+As of Perl 5.10, you can stack file test operators, in a way that
+C<-f -w -x $file> is equivalent to C<-x $file && -w _ && -f _>.
+
=item abs VALUE
=item abs
Index: t/op/filetest.t
===================================================================
--- t/op/filetest.t (revision 2678)
+++ t/op/filetest.t (working copy)
@@ -6,25 +6,17 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
+ require './test.pl';
}
use Config;
-print "1..10\n";
-
-print "not " unless -d 'op';
-print "ok 1\n";
-
-print "not " unless -f 'TEST';
-print "ok 2\n";
-
-print "not " if -f 'op';
-print "ok 3\n";
-
-print "not " if -d 'TEST';
-print "ok 4\n";
+plan(tests => 22);
-print "not " unless -r 'TEST';
-print "ok 5\n";
+ok( -d 'op' );
+ok( -f 'TEST' );
+ok( !-f 'op' );
+ok( !-d 'TEST' );
+ok( -r 'TEST' );
# make sure TEST is r-x
eval { chmod 0555, 'TEST' };
@@ -35,18 +27,19 @@ eval '$> = 1'; # so switch uid (may not
print "# oldeuid = $oldeuid, euid = $>\n";
-if (!$Config{d_seteuid}) {
- print "ok 6 #skipped, no seteuid\n";
-}
-elsif ($Config{config_args} =~/Dmksymlinks/) {
- print "ok 6 #skipped, we cannot chmod symlinks\n";
-}
-elsif ($bad_chmod) {
- print "#[$@]\nok 6 #skipped\n";
-}
-else {
- print "not " if -w 'TEST';
- print "ok 6\n";
+SKIP: {
+ if (!$Config{d_seteuid}) {
+ skip('no seteuid');
+ }
+ elsif ($Config{config_args} =~/Dmksymlinks/) {
+ skip('we cannot chmod symlinks');
+ }
+ elsif ($bad_chmod) {
+ skip( $@ );
+ }
+ else {
+ ok( !-w 'TEST' );
+ }
}
# Scripts are not -x everywhere so cannot test that.
@@ -55,20 +48,33 @@ eval '$> = $oldeuid'; # switch uid back
# this would fail for the euid 1
# (unless we have unpacked the source code as uid 1...)
-print "not " unless -r 'op';
-print "ok 7\n";
+ok( -r 'op' );
# this would fail for the euid 1
# (unless we have unpacked the source code as uid 1...)
-if ($Config{d_seteuid}) {
- print "not " unless -w 'op';
- print "ok 8\n";
-} else {
- print "ok 8 #skipped, no seteuid\n";
+SKIP: {
+ if ($Config{d_seteuid}) {
+ ok( -w 'op' );
+ } else {
+ skip('no seteuid');
+ }
}
-print "not " unless -x 'op'; # Hohum. Are directories -x everywhere?
-print "ok 9\n";
+ok( -x 'op' ); # Hohum. Are directories -x everywhere?
-print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";
-print "ok 10\n";
+is( "@{[grep -r, qw(foo io noo op zoo)]}", "io op" );
+
+# Test stackability of filetest operators
+
+ok( defined( -f -d 'TEST' ) && ! -f -d _ );
+ok( !defined( -e 'zoo' ) );
+ok( !defined( -e -d 'zoo' ) );
+ok( !defined( -f -e 'zoo' ) );
+ok( -f -e 'TEST' );
+ok( -e -f 'TEST' );
+ok( defined(-d -e 'TEST') );
+ok( defined(-e -d 'TEST') );
+ok( ! -f -d 'op' );
+ok( -x -d -x 'op' );
+ok( (-s -f 'TEST' > 1), "-s returns real size" );
+ok( -f -s 'TEST' == 1 );
Index: ext/B/B/Concise.pm
===================================================================
--- ext/B/B/Concise.pm (revision 2678)
+++ ext/B/B/Concise.pm (working copy)
@@ -423,6 +423,12 @@ $priv{"threadsv"}{64} = "SVREFd";
$priv{"exit"}{128} = "VMS";
$priv{$_}{2} = "FTACCESS"
for ("ftrread", "ftrwrite", "ftrexec", "fteread", "ftewrite", "fteexec");
+$priv{$_}{4} = "FTSTACKED"
+ for ("ftrread", "ftrwrite", "ftrexec", "fteread", "ftewrite", "fteexec",
+ "ftis", "fteowned", "ftrowned", "ftzero", "ftsize", "ftmtime",
+ "ftatime", "ftctime", "ftsock", "ftchr", "ftblk", "ftfile", "ftdir",
+ "ftpipe", "ftlink", "ftsuid", "ftsgid", "ftsvtx", "fttty", "fttext",
+ "ftbinary");
sub private_flags {
my($name, $x) = @_;
Index: op.c
===================================================================
--- op.c (revision 2691)
+++ op.c (working copy)
@@ -5023,6 +5023,9 @@ Perl_ck_ftst(pTHX_ OP *o)
OP_IS_FILETEST_ACCESS(o))
o->op_private |= OPpFT_ACCESS;
}
+ if (PL_check[kid->op_type] == MEMBER_TO_FPTR(Perl_ck_ftst)
+ && kid->op_type != OP_STAT && kid->op_type != OP_LSTAT)
+ o->op_private |= OPpFT_STACKED;
}
else {
op_free(o);
Index: op.h
===================================================================
--- op.h (revision 2678)
+++ op.h (working copy)
@@ -207,6 +207,7 @@ Deprecated. Use C<GIMME_V> instead.
/* Private of OP_FTXXX */
#define OPpFT_ACCESS 2 /* use filetest 'access' */
+#define OPpFT_STACKED 4 /* stacked filetest, as in "-f -x $f" */
#define OP_IS_FILETEST_ACCESS(op) \
(((op)->op_type) == OP_FTRREAD || \
((op)->op_type) == OP_FTRWRITE || \
Index: dump.c
===================================================================
--- dump.c (revision 2678)
+++ dump.c (working copy)
@@ -624,9 +624,11 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO
if (o->op_private & OPpHUSH_VMSISH)
sv_catpv(tmpsv, ",HUSH_VMSISH");
}
- else if (OP_IS_FILETEST_ACCESS(o)) {
- if (o->op_private & OPpFT_ACCESS)
- sv_catpv(tmpsv, ",FT_ACCESS");
+ else if (PL_check[o->op_type] != MEMBER_TO_FPTR(Perl_ck_ftst)) {
+ if (OP_IS_FILETEST_ACCESS(o) && o->op_private & OPpFT_ACCESS)
+ sv_catpv(tmpsv, ",FT_ACCESS");
+ if (o->op_private & OPpFT_STACKED)
+ sv_catpv(tmpsv, ",FT_STACKED");
}
if (o->op_flags & OPf_MOD && o->op_private & OPpLVAL_INTRO)
sv_catpv(tmpsv, ",INTRO");
Index: pp_sys.c
===================================================================
--- pp_sys.c (revision 2678)
+++ pp_sys.c (working copy)
@@ -2877,13 +2877,23 @@ PP(pp_stat)
RETURN;
}
+/* This macro is used by the stacked filetest operators :
+ * if the previous filetest failed, short-circuit and pass its value.
+ * Else, discard it from the stack and continue. --rgs
+ */
+#define STACKED_FTEST_CHECK if (PL_op->op_private & OPpFT_STACKED) { \
+ if (TOPs == &PL_sv_no || TOPs == &PL_sv_undef) { RETURN; } \
+ else { (void)POPs; PUTBACK; } \
+ }
+
PP(pp_ftrread)
{
I32 result;
dSP;
+ STACKED_FTEST_CHECK;
#if defined(HAS_ACCESS) && defined(R_OK)
- STRLEN n_a;
if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
+ STRLEN n_a;
result = access(POPpx, R_OK);
if (result == 0)
RETPUSHYES;
@@ -2908,9 +2918,10 @@ PP(pp_ftrwrite)
{
I32 result;
dSP;
+ STACKED_FTEST_CHECK;
#if defined(HAS_ACCESS) && defined(W_OK)
- STRLEN n_a;
if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
+ STRLEN n_a;
result = access(POPpx, W_OK);
if (result == 0)
RETPUSHYES;
@@ -2935,9 +2946,10 @@ PP(pp_ftrexec)
{
I32 result;
dSP;
+ STACKED_FTEST_CHECK;
#if defined(HAS_ACCESS) && defined(X_OK)
- STRLEN n_a;
if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
+ STRLEN n_a;
result = access(POPpx, X_OK);
if (result == 0)
RETPUSHYES;
@@ -2962,9 +2974,10 @@ PP(pp_fteread)
{
I32 result;
dSP;
+ STACKED_FTEST_CHECK;
#ifdef PERL_EFF_ACCESS_R_OK
- STRLEN n_a;
if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
+ STRLEN n_a;
result = PERL_EFF_ACCESS_R_OK(POPpx);
if (result == 0)
RETPUSHYES;
@@ -2989,9 +3002,10 @@ PP(pp_ftewrite)
{
I32 result;
dSP;
+ STACKED_FTEST_CHECK;
#ifdef PERL_EFF_ACCESS_W_OK
- STRLEN n_a;
if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
+ STRLEN n_a;
result = PERL_EFF_ACCESS_W_OK(POPpx);
if (result == 0)
RETPUSHYES;
@@ -3016,9 +3030,10 @@ PP(pp_fteexec)
{
I32 result;
dSP;
+ STACKED_FTEST_CHECK;
#ifdef PERL_EFF_ACCESS_X_OK
- STRLEN n_a;
if ((PL_op->op_private & OPpFT_ACCESS) && SvPOK(TOPs)) {
+ STRLEN n_a;
result = PERL_EFF_ACCESS_X_OK(POPpx);
if (result == 0)
RETPUSHYES;
@@ -3041,8 +3056,11 @@ PP(pp_fteexec)
PP(pp_ftis)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
RETPUSHYES;
@@ -3055,8 +3073,11 @@ PP(pp_fteowned)
PP(pp_ftrowned)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (PL_statcache.st_uid == (PL_op->op_type == OP_FTEOWNED ?
@@ -3067,8 +3088,11 @@ PP(pp_ftrowned)
PP(pp_ftzero)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (PL_statcache.st_size == 0)
@@ -3078,8 +3102,11 @@ PP(pp_ftzero)
PP(pp_ftsize)
{
- I32 result = my_stat();
+ I32 result;
dSP; dTARGET;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
#if Off_t_size > IVSIZE
@@ -3092,8 +3119,11 @@ PP(pp_ftsize)
PP(pp_ftmtime)
{
- I32 result = my_stat();
+ I32 result;
dSP; dTARGET;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
PUSHn( (((NV)PL_basetime - PL_statcache.st_mtime)) / 86400.0 );
@@ -3102,8 +3132,11 @@ PP(pp_ftmtime)
PP(pp_ftatime)
{
- I32 result = my_stat();
+ I32 result;
dSP; dTARGET;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
PUSHn( (((NV)PL_basetime - PL_statcache.st_atime)) / 86400.0 );
@@ -3112,8 +3145,11 @@ PP(pp_ftatime)
PP(pp_ftctime)
{
- I32 result = my_stat();
+ I32 result;
dSP; dTARGET;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
PUSHn( (((NV)PL_basetime - PL_statcache.st_ctime)) / 86400.0 );
@@ -3122,8 +3158,11 @@ PP(pp_ftctime)
PP(pp_ftsock)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (S_ISSOCK(PL_statcache.st_mode))
@@ -3133,8 +3172,11 @@ PP(pp_ftsock)
PP(pp_ftchr)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (S_ISCHR(PL_statcache.st_mode))
@@ -3144,8 +3186,11 @@ PP(pp_ftchr)
PP(pp_ftblk)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (S_ISBLK(PL_statcache.st_mode))
@@ -3155,8 +3200,11 @@ PP(pp_ftblk)
PP(pp_ftfile)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (S_ISREG(PL_statcache.st_mode))
@@ -3166,8 +3214,11 @@ PP(pp_ftfile)
PP(pp_ftdir)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (S_ISDIR(PL_statcache.st_mode))
@@ -3177,8 +3228,11 @@ PP(pp_ftdir)
PP(pp_ftpipe)
{
- I32 result = my_stat();
+ I32 result;
dSP;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
+ SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
if (S_ISFIFO(PL_statcache.st_mode))
@@ -3201,7 +3255,9 @@ PP(pp_ftsuid)
{
dSP;
#ifdef S_ISUID
- I32 result = my_stat();
+ I32 result;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
@@ -3215,7 +3271,9 @@ PP(pp_ftsgid)
{
dSP;
#ifdef S_ISGID
- I32 result = my_stat();
+ I32 result;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
@@ -3229,7 +3287,9 @@ PP(pp_ftsvtx)
{
dSP;
#ifdef S_ISVTX
- I32 result = my_stat();
+ I32 result;
+ STACKED_FTEST_CHECK;
+ result = my_stat();
SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
@@ -3247,6 +3307,8 @@ PP(pp_fttty)
char *tmps = Nullch;
STRLEN n_a;
+ STACKED_FTEST_CHECK;
+
if (PL_op->op_flags & OPf_REF)
gv = cGVOP_gv;
else if (isGV(TOPs))
@@ -3288,6 +3350,8 @@ PP(pp_fttext)
GV *gv;
STRLEN n_a;
PerlIO *fp;
+
+ STACKED_FTEST_CHECK;
if (PL_op->op_flags & OPf_REF)
gv = cGVOP_gv;
> The patch provides concise docs and tests, but no perldelta.pod
> patch. I think it's suitable for 5.8.2.
>
> Comments ?
Depends if 5.8.2 is happening in 2 weeks or 4 months. :-)
Nicholas Clark
For 5.8.3, then :-p
Or as a patched 5.8.1. (If I use 2 patched to 5.8.1, the step to 3
is small). ;-)
Abigail
I don't think there's enough lookahead to check whether an argument
is coming or not ; and moreoever this restriction seems a bit pointless
to me.
Since the "-bareword" construct is allowed in perl even with strictures,
my main concern is backward compatibility. For example -Args would
suddendly become a file test ! (and I'm sure one can come up with
more interesting words).
> (-f -x -w $file is too magical for my taste)
Tell the Perl 6 guys :)
Moin,
Rafael wrote:
What about -foo? :-) (Really, what about -ffff $file)?
I think we are getting closer to a new Black Perl Poem :)
>> (-f -x -w $file is too magical for my taste)
>
>Tell the Perl 6 guys :)
I think this feature has nothing to do in v5.8.x (e.g. in a maintainance
release). It should be reserved for v.5.9 and v5.10.
Best wishes,
Tels
- --
Signed on Sun Oct 12 16:29:31 2003 with key 0x93B84C15.
Visit my photo gallery at http://bloodgate.com/photos/
PGP key on http://bloodgate.com/tels.asc or per email.
"We have problems like this all of the time," Kirk said, trying to
reassure me. "Sometimes its really hard to get things burning." --
http://tinyurl.com/qmg5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
iQEVAwUBP4ll0ncLPEOTuEwVAQEKLgf6At7TzdtHPrT4op6itiCfy6gdE40Tomom
mJBgbTr5YrPfL2KfVikTQuHoL3Uv6qKlQeZXnKhUyrdU33dYJb9HersSPXhWx+MK
1rsR/Ku5YZx53xaSpVUONwM4tm9DIZjddH+98KTopcC5YmZ1YKvx1kaFs8bBqD75
zADLIjXwC3Ql1ka9bJmU/22vl9+IkKT2DX4tpU3qvngSWE8uIGmdvZZUZZEOySO6
PaCvvvGDyY6vXHe9O5Aqgi8rf4R3RAbk6R40WaRgmeJQ6cyLWyLGDH3+AGV5e67L
yXM7EIUX/cj4WPc0UySK4j7YamhW8IdFFrj1SjjwXAapOROhqTW/yA==
=WyGQ
-----END PGP SIGNATURE-----
It principle, I agree. But I think the urge to get new features in
maintainance releases partially comes from the fact that there are
years between 'normal' releases. 5.8.0 was released more than a year
ago, and we don't even have a 5.9.0 yet, nor any idea when we will
have a 5.10. When will 5.10 happen? 2004? 2005? 2006? Is it right
to say "we have this nice new feature, but you're going to have to
wait an unknown number of years before you can use it"?
If we look back at the history of Perl, it used to be different.
Here's an overview of how long after a previous release a new
major release was released.
5.000
5.001 5 months
5.002 10 months
5.003 4 months
5.004 11 months
5.005 14 months
5.6.0 20 months
5.8.0 28 months
But not only does the time between releases increase, the number of
minor releases decreases. In the 28 months between there has been
just on maintainance release, and 4 development releases.
Now, this shouldn't been seen as a criticism, nor am I saying people
should work harder. But the longer it takes for 5.10 to arrive, the
more pressure there will be for new features in 5.8.2.
Abigail
And I will resist them if they can cause breakage and don't fix bugs.
[And I might even be rude if people fail to heed politeness. Although
I will try not to be]
Nicholas Clark
Moin,
On Monday 13 October 2003 10:27, you wrote:
> On Sun, Oct 12, 2003 at 04:31:46PM +0200, Tels wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
I think we should take this as criticism. What happened to "release early,
release often"? When I see how fast the f.i. Mozilla Project churns through
revision numbers - I used v1.1 and now upgraded finally to v1.4 and it is
again not the latest stable...but the visible changes to the end-user are
very small. KDE is similiar, every time I get round to download the latest
update I notice that I didn't have time to install the last round, and there
is a new release again...
I think instead putting features into maintainance releases, we should aim for
much shorter release schedules. I fell into that pit at work, too, taking 8
months for one release. Now its at about 4, and even this is too long (But
he, it's just me and my trusted keyboard doing the work....).
I know that it is hard to push people, and also that there must be ample time
to experiemnt and try out new features. But the long release cycles are also
bad from a human, psychologic point of view. Many vendors, ISP, groups etc
will not use the latest stable version (because, "heh, it contains bugs, so
let's wait for the next version to fix them") but trail one back:
bash-2.05$ perl -v
This is perl, v5.6.1 built for i386-freebsd
Copyright 1987-2001, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
(box remains anonymous for obvious reasons :)
I guess if Perl was at 5.12 now, there would be more "desire" to update.
Of course, I cannot blame anyone here, we all do this in our spare time,
right? :-)
Best wishes,
Tels
PS: I know that the real world is not perfect.
- --
Signed on Mon Oct 13 18:52:34 2003 with key 0x93B84C15.
Visit my photo gallery at http://bloodgate.com/photos/
PGP key on http://bloodgate.com/tels.asc or per email.
"Where shall I put you? Under H, like Hot, Sexy Mama?"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
iQEVAwUBP4raNHcLPEOTuEwVAQG1WAf8Df3YTYosySi+NvMGzs68n/YlsGAEaKaj
RCtLiwZD/nk/Yxv4XNDqXRBZuLATgQ4zm32LTXdB+r+VK3bltL2d7Xeruz1SVm0g
kL0VSlUm9dxGfdl0rtHTTntwwgNJgedSlUsf4HHOMOOne7iWHvhiasM1WeV0nAH6
9gKjx4ShDUdmPWmLJWFehmOmY3mwj3ZZ2Osm5LVnKL9yf0h6jVWJQ3AqwK2xTBlq
Qkh3B2zSlbiNtdnx5cbbUAxvOETfaMkLqQIkPKSAhjJOZn+IsHI8HvEYadStUcaZ
g5XUFx1h9Cb/mTCrLwy1MnDBGJIMZ7el3KhYSBgk9wYWFuG6hkeS+Q==
=HXKX
-----END PGP SIGNATURE-----
I've thought further. My view is that as this is a visible syntax
change it's not suitable for (default) 5.8.x
My view is that as a visible syntax change, it's a policy question, and
therefore needs a decision by the blead pumpking.
(ie it would be hasty for anyone else to commit it)
Did the proposed perl6ish pramga ever get written?
(Is this waiting on full lexical pragmata? And what's happening about
that?)
If so, turning this on by a perl6ish pragma would seem viable even for
5.8.x (But only if it's at least that in 5.9)
Nicholas Clark
> This patch implements stacked filetest operators. With it, the combined
> expression C<-f -w -x $file> is equivalent to C<-x $file && -w _ && -f _>. It
> does so by adding a new private flag to filetest operators, OPpFT_STACKED,
> meaning that the immediate kid of a filetest operator is itself a filetest
> operator. A filetest op that has this flag short-circuits if the previous
> filetest returned false or undef, and uses the stat buffer if not.
>
> IIRC Perl 6 will provide this syntax (as well as the less
> backwards-compatible C<-fwx $file> combination, which I don't
> think is suitable for Perl 5.)
I've now applied this to bleadperl, as change #22294 (with a few
minor documentation tweaks to the original patch.)