Your code is replacing the number with the md5 of that number, which is a poor idea.
My suggestion was that you replace the number with the md5 of the files contents. Something like:
my $file = 'joe_34455667.jpg'; my $md5 = md5_hex( do{ local( @ARGV, $/) = $file; <> } ); $file =~ s[_(\d+)\.jpg$][_$md5.jpg];
In reply to Re^3: Renaming an image file
by BrowserUk
in thread Renaming an image file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |