#!/usr/bin/perl -w
opendir(DIR, './');
@files = readdir(DIR);
close(DIR);
foreach $file (@files){
 if($file =~ /(\S+)jpg/){
	$LowerCaseName = lcfirst($file);
	unless(-e $LowerCaseName){
		system("cp \"$file\" \"$LowerCaseName\"");
	}
	$JPGname = $1.'JPG';
	unless(-e $JPGname){
                system("cp \"$file\" \"$JPGname\"");
        }
 }
  if($file =~ /(\S+)JPG/){
        $jpgname = $1.'jpg';
        unless(-e $jpgname){
                system("cp \"$file\" \"$jpgname\"");
        }
 }
}
