go ahead... be a heretic | |
PerlMonks |
relative pathsby John M. Dlugosz (Monsignor) |
on Nov 26, 2001 at 10:13 UTC ( [id://127495]=perlquestion: print w/replies, xml ) | Need Help?? |
John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
Background: I'm still working on my documentation system. I'm storing the database of cross references as href targets that are all relative to the output tree. A reference within one document should be a relative path to get to the target. The Problem: Given two paths that are expressed relative to the same starting point, express the first as a relative path from the second. Example, given a\b\c to a\b\d, return ..\d . I'm sure I can figure this out easily enough, so I'm not asking anyone to do it for me. But sharing code that's already been tested is another story! Since there is abs2rel and other goodies in File::Spec, I'm wondering if there is already a function that does this somewhere, so I don't have to write one. Anybody seen it? —John
Back to
Seekers of Perl Wisdom
|
|