Path::Class, which you've already looked at, actually seems like a good one. It conveniently has the new_foreign and as_foreign methods. So you can do
and $path will be Unix style. So if you normalize your paths, i.e. consistantly make your paths into the same type, when you first see them you don't have to worry about it later on. Everything will Just Work. If you know that a path from outside is of a non-native type you can use foreign_dir($type, $path) instead.use Path::Class; my $path = dir($from_outside)->as_foreign('Unix');
Nowadays I pretty much only use Path::Class instead of File::Spec because path manipulation quickly gets dirty and Path::Class has handy methods, while retaining a good control of what's what regarding file system type and file/dir.
lodin
In reply to Re: CPAN Module for mixing Unix/Windows path
by lodin
in thread CPAN Module for mixing Unix/Windows path
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |