@file = `ls *[a-z].jpg`;

foreach $filename (@file)
{
   chomp($filename);
   $filename2 = $filename;
   $filename2 =~ s/[a-z].jpg/.jpg/ig;
   if (`diff $filename $filename2` eq '')
   {
      print "$filename and $filename2 are the same: delete $filename\n";
      unlink($filename);
   }
   else
   {
      print "!!!! $filename is different\n";
   }
}
