Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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 cooling their heels in the Monastery: (4)
As of 2016-02-06 19:09 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (235 votes), past polls