#!/usr/bin/perl -w foreach $filename (@ARGV) { $newname = $filename; $newname =~ tr/a-z/A-Z/; if ($newname ne $filename) { if ( -e $newname ) { print "ERROR: Won't clobber existing $newname.\n"; } else { print "Renaming $filename to $newname.\n"; rename($filename, $newname) or die "Cannot rename $filename to $newname due to $!"; } } }