Though Path::Class seems to be really good (and maybe I should have used it in place of File::Spec from the beginning), I don't see how it can handle my case, as it seems to require the *caller* to already know which style the pathes are.
For example, when running the following piece of code:
use Path::Class;
foreach $s ('x/y','x\y') {
$dir=Path::Class:Dir->new($s)->as_foreign('Unix');
print "$dir\n";
}
I would have wished that this would output
x/y
x/y
no matter whether the application is running on Unix or on Windows. But on Unix (for example), I get
x/y
x\y
I understand the behaviour of Path::Class: It is not designed to look into a path string and guess from there what OS type it is supposed to be - but this is the very thing I'm looking for.
--
Ronald Fischer <ynnor@mm.st>