Cirollo has asked for the wisdom of the Perl Monks concerning the following question:
Consider running this from the directory /home/myuser:
Shouldn't rel2abs get rid of the '..' and print "/home/bob" instead of "/home/myuser/../bob"? If that's not the expected behavior, 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?use File::Spec::Functions qw/rel2abs/; print rel2abs("../bob/");' __END__ /home/myuser/../bob
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: rel2abs doesn't resolve relative paths? (use Cwd)
by grinder (Bishop) on Jun 05, 2003 at 16:01 UTC | |
Re: rel2abs doesn't resolve relative paths?
by halley (Prior) on Jun 05, 2003 at 15:31 UTC | |
by tye (Sage) on Jun 05, 2003 at 15:36 UTC | |
Re: rel2abs doesn't resolve relative paths?
by Oberon (Monk) on Jun 07, 2003 at 01:17 UTC |
Back to
Seekers of Perl Wisdom