On Wed, 2004-01-21 at 11:52, McMahon, Chris wrote:
> Hello... 
>       This script works fine on Unix: 
> 
> #!/usr/local/bin/perl
> use warnings;
> use strict;
> my $dir = "/usr/home/admin";
> my @files = glob ("$dir/*");
> print @files;
> 
> 
> But this script doesn't do right in Windows: 
> 
> use warnings; 
> use strict; 
> my $dir = "E:\\Documents and Settings\\cmcmahon\\Desktop"; 
> print "$dir\n";  
> my @files = glob( "$dir\\*");
> print @files; 
> 
> The "print "$dir\n"" statement works fine, but the "print @files" statement
> yields the value "E:./Documentsand".  Can someone explain what Windows needs
> here?    

It's not windows, your spaces aren't escaped.  Either replace them with
a \s (whitespace char) or properly escape them.

-Dan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to