Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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.
grep
One dead unjugged rabbit fish later...


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-08-22 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (149 votes), past polls