in reply to Re: absolute pathname
in thread absolute pathname

rel2abs() has problems with volumes:
If $base is not present or ’’, then Cwd::cwd() is used. If $base is relative, then it is converted to absolute form using "rel2abs()". This means that it is taken to be relative to Cwd::cwd(). On systems with the concept of volume, if $path and $base appear to be on two different volumes, we will not attempt to resolve the two paths, and we will instead simply return $path.

Replies are listed 'Best First'.
Re^3: absolute pathname
by ikegami (Patriarch) on Aug 12, 2008 at 21:44 UTC

    That doesn't seem to apply to Windows.

    D:\>perl c:script.pl C:\path\script.pl D:\>perl c:..\ikegami\script.pl C:\path\script.pl

    I could still apply to other systems, though (VMS?)

    Update: Looking at the source, it uses getdcwd (as opposed to getcwd) with the appropriate volume, returning the correct path even when different volumes are involved.