in reply to Re: Absolute pathnames from relative?
in thread Absolute pathnames from relative?

The somewhat longer answer is that the OS (or filesystem implementation) is the ultimate authority on what the filesystem implementation really does. With a physical system check you can use the Cwd module and a cwd() combined with a pwd() to let the operating system figure out the correct interpretation.

An easier method using the Cwd method, albeit with the same limitation of being a filesystem-based implementation, is through the use of the abs_path method. For example:

# perl -MCwd=abs_path -le 'print abs_path("/usr/local/src/../bin/fnurg +le")' /usr/local/bin/fnurgle

 

perl -le 'print+unpack("N",pack("B32","00000000000000000000001000100010"))'

Replies are listed 'Best First'.
Re^3: Absolute pathnames from relative?
by superfrink (Curate) on Oct 14, 2005 at 21:58 UTC
    I'm bringing this thread back from the past but I'm doing something similar right now so I searched and found it.

    I already tried using abs_path. It works fine if the argument is a directory but not when the argument is a file.