if ( -e $file ) { rename ($file, $new) or die "Can not change $file to $new, $!\n"; } else { print "$file isn't there to be renamed $new\n"; }