in reply to rename files to upcase

rename is a built-in function. Using it would eliminate the need for File::Copy.

The following is definately untested. Wield at your own risk. ;)

perl -MFile::Find -e "find( sub{ rename( $_, uc $_ ) if -f $_; }, $ARG +V[0] );" path/name

Update: Remember, File::Find behaves recursively, unless you explicitly limit it. DO NOT turn this sort of script loose on a root directory, unless you want your entire filestructure to be uppercased.


Dave

Replies are listed 'Best First'.
Re^2: rename files to upcase
by gaal (Parson) on Nov 16, 2004 at 09:25 UTC
    you probably know this, but you can make this slightly more efficient if you add a guard against cases where $_ eq uc $_, saving a disk access. This isn't really important in a one-liner though.