in reply to Re^3: Renaming an image file
in thread Renaming an image file
If I run your code:my $md5 = md5_hex( do{ local( @ARGV, $/) = $file; <> } );
I get "use of uninitialized value $_ in substitution (s///) My goal is just replace the file names with some name that is not going to be the same insisde of this directory, why replacing the number with the md5 of that number is a poor idea?my $file = 'joe_34455667.jpg'; my $md5 = md5_hex( do{ local( @ARGV, $/) = $file; <> } ); $file =~ s[_(\d+)\.jpg$][_$md5.jpg];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Renaming an image file
by BrowserUk (Patriarch) on Nov 28, 2010 at 17:37 UTC | |
by Anonymous Monk on Nov 28, 2010 at 18:02 UTC | |
by BrowserUk (Patriarch) on Nov 28, 2010 at 18:09 UTC | |
by Anonymous Monk on Nov 28, 2010 at 18:44 UTC | |
by BrowserUk (Patriarch) on Nov 28, 2010 at 19:02 UTC | |
by Anonymous Monk on Nov 28, 2010 at 21:23 UTC |