in reply to Need to change directory string.
"..Is there easier way to put this?.."
Another way is to use canonpath method from File::Spec like so:
Output:use strict; use warnings; use File::Spec qw(canonpath); my $dir_str = "test/home/players/demo//thumbs/super.jpg"; print File::Spec->canonpath($dir_str);
test/home/players/demo/thumbs/super.jpg
NOTE:
No physical check on the filesystem, but a logical cleanup of a path.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
|
---|
In Section
Seekers of Perl Wisdom