Update

I investigated this problem some more. I ran the script below on Win2k (problem present) and on Linux (problem absent).

Question to experienced monks: Where should I report the bug? ActiveState, or perl 5 porters?

Rudif

#! /usr/bin/perl -w use strict; # # This script checks the behavior of filetest -x _ # and demonstrates a problem in Win2k where filetest2() and filetest3( +) below # fail to classify the 2 test files (a script and the perl interpreter +) as executable. # By rudif@bluemail.ch 26 Jun 2001 # my ($script, $exe); if ($^O =~ /Win/) { # assume the usual directory - please edit if different on your ma +chine ($script, $exe) = qw ( c:/perl/bin/pod2html.bat c:/perl/bin/perl.e +xe ); } else { # assume *nix # assume the usual directory - please edit if different on your ma +chine ($script, $exe) = qw ( /usr/bin/pod2html /usr/bin/perl ); } die "no such file $script" unless -f $script; die "no such file $exe" unless -f $exe; printf "OS $^O, perl %vd\n\n", $^V; compare(filetest0($exe), filetest1($exe)); compare(filetest0($exe), filetest2($exe)); compare(filetest0($exe), filetest3($exe)); compare(filetest0($exe), filetest4($exe)); print "\n"; compare(filetest0($script), filetest1($script)); compare(filetest0($script), filetest2($script)); compare(filetest0($script), filetest3($script)); compare(filetest0($script), filetest4($script)); print "\n"; sub filetest0 { # reference - not using _ my $file = shift; my @props; push @props, "Readable" if -r $file; push @props, "Writable" if -w $file; push @props, "Executable" if -x $file; push @props, "Binary" if -B $file; push @props, "Text" if -T $file; join ' ', "filetest0 $file: ", sort @props; } sub filetest1 { my $file = shift; stat($file); my @props; push @props, "Readable" if -r _; push @props, "Writable" if -w _; push @props, "Executable" if -x _; # before -B and -T push @props, "Binary" if -B _; push @props, "Text" if -T _; join ' ', "filetest1 $file: ", sort @props; } sub filetest2 { my $file = shift; stat($file); my @props; push @props, "Readable" if -r _; push @props, "Writable" if -w _; push @props, "Text" if -T _; push @props, "Executable" if -x _; # after -T _ push @props, "Binary" if -B _; join ' ', "filetest2 $file: ", sort @props; } sub filetest3 { my $file = shift; stat($file); my @props; push @props, "Readable" if -r _; push @props, "Writable" if -w _; push @props, "Text" if -T $file; # after -T $file push @props, "Executable" if -x _; push @props, "Binary" if -B _; join ' ', "filetest3 $file: ", sort @props; } sub filetest4 { my $file = shift; stat($file); my @props; push @props, "Readable" if -r _; push @props, "Writable" if -w _; push @props, "Text" if -T _; push @props, "Executable" if -x $file; # not using _ push @props, "Binary" if -B _; join ' ', "filetest4 $file: ", sort @props; } sub compare { my ($ref, $other) = @_; (my $_ref = $ref) =~ s/.*://; (my $_other = $other) =~ s/.*://; if ($_ref eq $_other) { printf " ok $other\n", } else { printf "not ok $other\n", } } __END__ # output on Win2k OS MSWin32, perl 5.6.1 ok filetest1 c:/perl/bin/perl.exe: Binary Executable Readable Wri +table not ok filetest2 c:/perl/bin/perl.exe: Binary Readable Writable not ok filetest3 c:/perl/bin/perl.exe: Binary Readable Writable ok filetest4 c:/perl/bin/perl.exe: Binary Executable Readable Wri +table ok filetest1 c:/perl/bin/pod2html.bat: Executable Readable Text W +ritable not ok filetest2 c:/perl/bin/pod2html.bat: Readable Text Writable not ok filetest3 c:/perl/bin/pod2html.bat: Readable Text Writable ok filetest4 c:/perl/bin/pod2html.bat: Executable Readable Text W +ritable

In reply to Re: Problem with filetest -x _ on Win2k AS Perl build 626 by Rudif
in thread Problem with filetest -x _ on Win2k AS Perl build 626 by Rudif

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.