On 12/23/06, Ken Foskey <[EMAIL PROTECTED]> wrote:
On Thu, 2006-12-21 at 16:45 +0000, Bryan K. Wright wrote: > Hi folks, > > I'm porting a script to Windows, and I've run into an > odd mismatch between the results returned by "glob" and the > -f operator. If I take a test script like the following: > > my @files = glob ("*.exe"); > for my $f (@files) { > print "Processing \"$f\"...\n"; > -f $f && process_file($f); > } > > I find that any file name returned by glob fails the "-f" test. > If I put the same file name directly into "-f", the test succeeds. > There don't appear to be any extra trailing or leading characters > on the glob results. > > The only explanation I can think of is that it's a > character set problem. Can anybody explain what's going on here?You might want to give us the filename that it is failing on. Might give us a clue.
Bryan, I'm running a windows machine, and I couldn't replicate your results. What happens if you cd into the directory you'll be working with and just run this: C:\yourDirectory\>perl -e "print (qq/-f $_ : /, -f $_, qq/\n/) foreach glob '*.exe'" I played around with this myself, making files names with spaces and ugly characters, but I couldn't get it to fail. What filenames fail (ie, aren't followed by a '1' on the output) when you run this? - Jen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
