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

Re: How do I get the full path for a file?

by Fastolfe (Vicar)
on Jun 22, 2002 at 23:44 UTC ( [id://176553]=note: print w/replies, xml ) Need Help??


in reply to How do I get the full path for a file?

If you have a filename, then you probably already have some "relative" path to that filename, even if we're making the assumption that you're working from the current directory.

In this case, File::Spec will do the job for you with its rel2abs function:

$abs_path = File::Spec->rel2abs($filename);
If you have a file but have no idea where it's located, you might want to use File::Find.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2025-06-16 21:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.