- use File::Find to get an array of the file names.
- Then you can use a regex to separate the file names into their constituent parts. eg
my($words,$fix_num,$remainder)= $filename=~ /(.*?)(\s\d+)(\s-\s\d{3}\.jpg)/;
- sprintf will then allow you to specify the padding on $fix_num
- Then rename the files with rename
Have a go at doing this and come back with your code if you have any problems ;)
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."