in reply to Making File::Spec cross platform

Once you put your paths together, you can use the abs_path() function from the Cwd module. It does what you want with the relative path and symlinks.

--
brian d foy <brian@stonehenge.com>

Replies are listed 'Best First'.
Re^2: Making File::Spec cross platform
by DrWhy (Chaplain) on May 20, 2005 at 14:49 UTC
    This needs to work on (at least) Win32 and *nix. When this path is fed to Cwd::abs_path() on a MSWindows system the dir separator will be '\'. I was under the impression that Cwd only dealt with '/' as a separator. Am I mistaken? What about the (hypothetical and increasingly unlikely) scenario where I want this to also work under a pre-OSX MacOS whose separator is ':'?

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."