I have a Perl script on Windows that needs to access files using UNC paths. However, I am getting weird results (using Perl 5.8.6):
C:\>perl -e "print -d 'C:\Windows'"
1
C:\>perl -e "print -d 'C:/Windows'"
1
C:\>perl -e "print -d '\\server\share'"
C:\>perl -e "print -d '//server/share'"
1
So locally, I can use either slashes or backslashes. Via UNC, however, I can only use slashes. That is weird in itself, but really annoying considering this behaviour:
C:\>perl -MFile::Spec::Functions -e "print catfile('//test/dir', 'test
+2');"
\\test\dir\test2
Which means my platform-independant script that uses catfile/catdir suddenly doesn't work on Windows with UNC paths. If I would have done stuff manually with my $name = "$dir/$file", I'd be fine now :-(.
Is this considered a bug in Perl, or a bug in File::Spec::Functions?