in reply to Re^2: CPAN Module for mixing Unix/Windows path
in thread CPAN Module for mixing Unix/Windows path
I don't quite understand the problem.
From the OP: Internally, I use / as a separator whenever possible. For path strings I get from the "outside", I use File::Spec to be OS independent.
Do any paths come from somewhere else, that you can't keep track of and normalize? My point is that Path::Class, just as File::Spec which it uses internally, expects Unix style paths when run on Unix, and Windows style paths when run on Windows, unless you tell it otherwise. So for new never-before-seen paths you do
and once they're internal, you just domy $path = dir($from_outside)->as_foreign('Unix');
Is this unapplicable to your problem?my $path = foreign_dir('Unix', $internal);
lodin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: CPAN Module for mixing Unix/Windows path
by rovf (Priest) on Jun 06, 2008 at 08:52 UTC |