in reply to Re: convert a given dir name to its absolute path
in thread convert a given dir name to its absolute path

the $abs_path is empty, can you check - $abs_path = File::Spec->rel2abs( "../../"); print $abs_path,"\n"; I got this empty (??) Could you please advice ? Thanks azaria
  • Comment on Re^2: convert a given dir name to its absolute path

Replies are listed 'Best First'.
Re^3: convert a given dir name to its absolute path (bugs?)
by xdg (Monsignor) on Dec 22, 2005 at 13:59 UTC

    There are bugs in File::Spec that have to do with relative and absolute paths. Some are recently fixed, some fixes are still in developer releases. This may be related. You might want to see if upgrading File::Spec helps. See the change log for details.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re^3: convert a given dir name to its absolute path
by tirwhan (Abbot) on Dec 22, 2005 at 12:45 UTC

    Executed in /usr/local/bin:

    $abs_path = File::Spec->rel2abs( "../../"); print "$abs_path\n __OUTPUT__ /usr/local/bin/../..

    So it works correctly on my platform (Linux with perl 5.8.4).


    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan