http://www.perlmonks.org?node_id=909902


in reply to using find2perl to replace spaces with underscores

You could use the output of find2perl as a good starting point for your own script, so rather than piping it to perl, redirect to a file, eg.

find2perl . -depth -eval 'my $o=$_; tr/ /_/; -e or rename $o,$_ or warn "cannot rename $o to $_: $!"' > replace_spaces.pl