Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How do I remove current path from a dir listing

by tye (Sage)
on Oct 06, 2000 at 19:05 UTC ( [id://35586]=note: print w/replies, xml ) Need Help??


in reply to How do I remove current path from a dir listing

I strongly recommend using File::Spec:

use File::Spec; $rel_path= File::Spec->abs2rel( $abs_path );
or
use File::Spec::Functions qw( abs2rel ); $rel_path= abs2rel( $abs_path );
You can also provide a second argument to abs2rel() that tells it to strip a directory other than the current working directory.

See also my review of File::Spec.

        - tye

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found