in reply to Re^2: How to cut the directory path?
in thread How to cut the directory path?
Or you could use split and then paste together the pieces you need.my $filespec = "/usr/share/directory/piano_book.mp4"; my $relative = "." . $1 if $filespec =~ m{/usr/share(.*)};
But you'd most probably be better off with a specialized module such as Path::Tiny mentioned above or some other.
|
|---|