Think about Loose Coupling | |
PerlMonks |
Re: rel2abs doesn't resolve relative paths?by Oberon (Monk) |
on Jun 07, 2003 at 01:17 UTC ( [id://263897]=note: print w/replies, xml ) | Need Help?? |
> ... are there any standard functions that would return "/home/bob" or will I have to write my own subroutine to get rid of the ..'s?
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 ...
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.
In Section
Seekers of Perl Wisdom
|
|