in reply to Need to change directory string.
use warnings; use strict; my $dir_str = "test/home/players/demo//thumbs/super.jpg"; $dir_str =~ s{//+}{/}g; print "$dir_str\n"; __END__ test/home/players/demo/thumbs/super.jpg
UPDATE: fixed typo. Thanks Athanasius
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need to change directory string.
by Athanasius (Archbishop) on Jan 02, 2013 at 16:36 UTC |