Keep It Simple, Stupid | |
PerlMonks |
Re: UNC vs. standard Perl functionsby brian_d_foy (Abbot) |
on Mar 16, 2005 at 18:40 UTC ( [id://440081]=note: print w/replies, xml ) | Need Help?? |
It's not a bug in Perl, and it's not a bug in File::Spec::Functions: it's documented (and intended) behavior. At the beginning of File::Spec, it looks at the value of $^O to see which operating system it's on, then selects an appropriate subclass. On Windows, that's File::Spec::Win32, and in that module it defines the directory separator. You want it to pick something else. You could add a subclass for UNC so the module handles the root directory and other things correctly, or you can make File::Spec think that it's on another system. I sometimes need to do this to work with paths from other systems without turning them into UNIX paths.
I run this on FreeBSD and get "top\middle\bottom".
-- brian d foy <bdfoy@cpan.org>
In Section
Seekers of Perl Wisdom
|
|