Another Ed has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
I'm trying to use Perl's glob against a Windows network (i.e. UNC) path, where the first part of that path is held in a variable. I want to cater for cases where the part of the path held in the variable may contain whitespace, so I add the protection of an extra layer of quotes around it:
my $dir = '//datastore/genexternal/aoi'; print glob "'$dir/*'";
This simply doesn't work: it prints nothing. I get the same results in both Strawberry Perl and Active State Perl, running on Windows XP or Windows 7. I get these results in Active State Perl 5.10.1, running on either Windows XP or Windows 7.
It also does not work if:
I get the same results if I try switching the slash characters to backslashes.
By contrast, each of the following does work:
Do you have any idea why it should fail for my UNC path?
Ed
|
|---|