in reply to File test -T (text) and quoted filenames

Are you sure you need the quoting at all? I did a quick test (on linux) and it seemed to work with spaces:

perl -e ' $t= "test and more.txt"; print "yes" if -T $t' #prints yes

It should work the same on windows I think

Replies are listed 'Best First'.
Re^2: File test -T (text) and quoted filenames
by ww (Archbishop) on Feb 11, 2011 at 13:55 UTC

    Testing W32 files names w/spaces:

    #!/usr/bin/perl use strict; use warnings; my $fullelementpath = "f:/_wo/haldane.txt"; if (-T $fullelementpath) {print "passed T\n";}else{print "failed for $ +fullelementpath\n";} # ----------------------- my $fullelementpath2 = "f:/_wo/haldane space.txt"; if (-T $fullelementpath2) {print "passed T\n";}else{print "failed for +$fullelementpath2\n";}

    Output:

    C:\>pl_test\887602.pl passed T passed T C:\>