Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://678598]
help
Chatterbox?
[choroba]: Corion ad functional: in Erlang, it's even more like Prolog, as its syntax is very close to Prolog's
[Corion]: choroba: I've only dabbled in Erlang a bit, and I don't even remember what program I wrote in it :)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2017-12-11 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (290 votes). Check out past polls.

    Notices?