I have a lot of files I\'m trying to rename, I tried to make a regular expression to match them, but even that I got stuck on the files are named like:
use strict;
use File::Copy;
my @files = glob 'File*Name*';
foreach my $filename (@files) {
if ($filename =~ m`^.*File.*Name.*?(\d+)`) {
my $number = $1;
next if ($number > 99);
rename $filename, sprintf("FileName%03d",$number);
}
}