Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 romping around the Monastery: (12)
As of 2015-07-06 22:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls