in reply to rel2abs doesn't resolve relative paths?
My solution to this problem has been to grab File::VirtualPath. It's not standard, but at least you wouldn't have to write your own ...
# warning! untested code ahead use File::VirtualPath; my $p = File::VirtualPath->new(); $p->path("/home/myuser"); # or use cwd() $p->chdir("../bob/"); print $p->path_string(); # should yield /home/bob
And of course you could wrap all that up in a sub if you like. I like this particular solution because it works even if you're referring to a path that doesn't exist (maybe it doesn't exist yet, but it will, or it's a path to something other than a physical file in the file system).
HTH.
|
|---|