Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: How do monks create paths?

by grep (Monsignor)
on Apr 06, 2008 at 03:19 UTC ( #678598=note: print w/ replies, xml ) Need Help??

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.

sub abspath { # split anything that looks like a unix path seperator + my @tokens = map { defined $_ and split /\/+/ } @_; @tokens = grep { $_ ne '' } @tokens; return join( '/', '', @tokens ); }
Which could adapted to use File::Basename which would handle other OS's.
One dead unjugged rabbit fish later...

Comment on Re: How do monks create paths?
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://678598]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2015-11-27 01:47 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (712 votes), past polls