in reply to Renaming bunches of files

If you really are just renaming, why not just use the "rename" function? (`perldoc -f rename`)
ls *FOO* | perl -ne 'chomp; $o=$_; s/FOO/BAR/; rename $o,$_'
(Does the "File::Copy::move()" function really do anything different from this?)

Replies are listed 'Best First'.
Re: Re: Renaming bunches of files
by Limbic~Region (Chancellor) on Aug 08, 2003 at 05:12 UTC
    graff,
    Yes. rename does not work across file systems (usually). Now while the original code is changing the name in place, using File::Copy instead of rename allows modifications to the location of the new file without breaking anything.

    Cheers - L~R