in reply to How do monks create paths?
For unixy stuff I use this. It gives me an absolute path without worrying about how trailing slashes were handled.
Which could adapted to use File::Basename which would handle other OS's.sub abspath { # split anything that looks like a unix path seperator + my @tokens = map { defined $_ and split /\/+/ } @_; @tokens = grep { $_ ne '' } @tokens; return join( '/', '', @tokens ); }
grep
One dead unjugged rabbit fish later...
One dead unjugged rabbit fish later...
|
---|
In Section
Seekers of Perl Wisdom