in reply to Renaming file without forward slash
Is this what you're looking for?... foreach $word (@file) { if ((my $new = $word) =~ s/\.txt$//) { rename($word, $new) or die "unable to rename $word to $new: $!\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Renaming file without forward slash
by Ball_22_11 (Initiate) on Feb 25, 2008 at 04:20 UTC |