@file = `ls *jpg`;

$count=1;

foreach $filename (@file)
{
   chomp($filename);
   $newfilename = sprintf("%05d", $count);
   $newfilename = $newfilename . ".jpg";
   `mv -iv $filename $newfilename`;
   print "mv -iv $filename $newfilename\n";
   $count++;
}

