develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #77388] Stacked file tests with -T, -t and/or -B remove too much from the stack

Thread Previous | Thread Next
Father Chrysostomos via RT
January 20, 2012 14:13
[perl #77388] Stacked file tests with -T, -t and/or -B remove too much from the stack
Message ID:
On Sat Jan 14 00:58:12 2012, sprout wrote:
> On Thu Jan 12 13:30:10 2012, sprout wrote:
> > Except that can’t really work either, because what would -r -t do? 
> > After all, -t doesn’t *set* the stat buffer, either.
> > 
> > I propose we make stacked -t an error in 5.16.  It has never worked,
> > it’s not clear how it should work, and if we try to make it do something
> > illogical we’ll be stuck ‘supporting’ that behaviour.
> > 
> But maybe later we could make -t work with _.

I was about to make stacked -t a compile time error, when I realised
that it would break objects with -X overloading, which currently *do*
work with stacked -t.

So I realised the real problem: When overloading is not present, the -r
in -r -w foo uses _.  When overloading is present, -w arranges for -r to
receive the same argument.

So it only makes sense to me to use the latter mechanism for stacked -t.

Using the former still makes sense for other filetest operators, because
-r -w foo should only do one stat, not two.

(Is anybody reading this?)


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About