in reply to Problem with filetest -x _ on Win2k AS Perl build 626

in POD::Find version 0.12, the file tests are in your suggested order:

unless($file =~ /\.(pod|pm|plx?)\z/i || (-f $file && -x _ && -T _))

And with these, it works fine on my system.

Replies are listed 'Best First'.
Re: Re: Problem with filetest -x _ on Win2k AS Perl build 626
by Rudif (Hermit) on Jun 25, 2001 at 03:15 UTC
    >> in POD::Find version 0.12, the file tests are in your suggested order:

    Oops, I forgot to mention my version of Pod::Find - it is 0.21 and it came in the current distribution of Pod-Parser-1.18 on CPAN. The file Pod/Find.pm is dated 1-Sep-2000.

    Is your version 0.12 much older? And is it POD or Pod?

    Anyway, what is bugging me is that changing the order of evaluation of the 3 terms in the && expression can change the boolean result - this looks like a bug to me.

    What happens if you change your

    unless($file =~ /\.(pod|pm|plx?)\z/i || (-f $file && -x _ && -T _))
    to
    unless($file =~ /\.(pod|pm|plx?)\z/i || (-f $file && -T _ && -x _ ))
    - does it change the boolean result?

    Rudif

      Version 0.12 came with 5.6.0, apparently. Version 0.21 came with 5.6.1. And it's Pod::Find, except that dumb Windoze doesn't care. One of the differences between the two versions:

      # check extension or executable flag # this involves testing the .bat extension on Win32! - unless($file =~ /\.(pod|pm|plx?)\z/i || (-f $file && -x _ && -T _ +)) { - return undef; + unless(-f $file && -T _ && ($file =~ /\.(pod|pm|plx?)\z/i || -x _ + )) { + return undef; }

      When I ran your test code, I got a 0 for the first test, and a 1 for subsequent tests. I don't feel like firing up NT again to check it, but I think turning the test around would fix it.