Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How do monks create paths? (Path::Class)

by lodin (Hermit)
on Apr 06, 2008 at 10:24 UTC ( [id://678629]=note: print w/replies, xml ) Need Help??


in reply to How do monks create paths?

Have you looked at Path::Class? If not you definately should check it out. I haven't used it much myself yet, but it looks nice and has great reviews at CPAN.

Under the cover it uses File::Spec so it is portable. Here's an example using it on Windows:

use Path::Class; my $path = file('', qw[ foo bar baz baz.txt ]); # The '' is to make it absolute. See comment in the doc. print $path, "\n"; print $path->as_foreign('Unix'), "\n"; __END__ \foo\bar\baz\baz.txt /foo/bar/baz/baz.txt

lodin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found