List Info

Thread: Re: glob doesn't work on UNC paths?




Re: glob doesn't work on UNC paths?
country flaguser name
United States
2007-03-07 18:00:54
Roode, Eric wrote:
> 
> Yes, that's true.  Although a little experimentation
shows that
> the spaces have to be prefixed with backslashes for
glob() to work
> properly.
> 
> So it looks like I'll have to take the user's input
and
>     tr/\///;
>     s/ /\ /g;
> 
> Sound about right?

Worked for me without escaping the spaces:

use strict;
use warnings;

my $path = '\\Dollar\C\TempNew Folder';

print "$pathn";
(my $gpath = $path) =~ s|\|/|g;
print "$gpathn";
print "$_n" foreach glob "$gpath/*";

__END__

//Dollar/C/Temp/New Folder/a b c.d
//Dollar/C/Temp/New Folder/foo
//Dollar/C/Temp/New Folder/fubar.txt
_______________________________________________
ActivePerl mailing list
ActivePerllistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )