in reply to How do I remove current path from a dir listing
I strongly recommend using File::Spec:
oruse File::Spec; $rel_path= File::Spec->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.use File::Spec::Functions qw( abs2rel ); $rel_path= abs2rel( $abs_path );
See also my review of File::Spec.
- tye
|
|---|