in reply to Re: CPAN Module for mixing Unix/Windows path
in thread CPAN Module for mixing Unix/Windows path
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:
I would have wished that this would outputuse Path::Class; foreach $s ('x/y','x\y') { $dir=Path::Class:Dir->new($s)->as_foreign('Unix'); print "$dir\n"; }
no matter whether the application is running on Unix or on Windows. But on Unix (for example), I getx/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.x/y x\y
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CPAN Module for mixing Unix/Windows path
by lodin (Hermit) on Jun 05, 2008 at 18:01 UTC | |
by rovf (Priest) on Jun 06, 2008 at 08:52 UTC | |
|
Re^3: CPAN Module for mixing Unix/Windows path
by mandarin (Hermit) on Jun 05, 2008 at 12:48 UTC | |
by rovf (Priest) on Jun 05, 2008 at 13:31 UTC |