in reply to Re^4: Mass file renaming
in thread Mass file renaming
This has probably nothing to do with your problem, but I'd suggest that you put a couple of markers around the variables you print, like in:
just to be sure that there aren't stray trailing spaces wandering in your string. You could also go deeeper trying to see some hex dump of the strings, for example with:if ($success){ print "Changed [$oldname] to [$newname]\n" } else { print "Failed to rename [$oldname] to [$newname] $!\n"; exit };
If you don't want to check these hex dumps, you can ensure that your filename only contains letters, digits and dots:sub hex_dump { unpack "H*", $_[0]; } print "\$oldname = [", hex_dump($oldname), "]\t"; print "\$newname = [", hex_dump($newname), "]\n";
$newname =~ tr/a-zA-Z0-9\.//cd;
Back to your particular case: are you sure that the destination file -- i.e. 573427RSSt.csv -- does not exist or, if it exists, it is writeable?
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Mass file renaming
by interstellar (Initiate) on Nov 07, 2005 at 17:11 UTC |