http://www.perlmonks.org?node_id=733225


in reply to Re^2: How to prefix a string to all the files in a directories as well subdirectories
in thread How to prefix a string to all the files in a directories as well subdirectories

Like this:
#!/usr/bin/perl use strict; use warnings; use File::Find; sub callback { my $file = $_; rename $file,"reference_$file" if -f $file } my $dir = 'C:/Image_Repository'; find (\&callback, $dir);
Of course, there is always More Than One Way To Do It, so you can "hand craft" it if you enjoy lots of typing, but it probably won't be as efficient as using File::Find.
  • Comment on Re^3: How to prefix a string to all the files in a directories as well subdirectories
  • Download Code