perl -MFile::Find -pi -e'BEGIN { find( sub { push @ARGV, $File::Find::name if /\.txt\z/i }, "." ) } s/find/replace/' #### perl -MFile::Find::Rule -pi -e'BEGIN { @ARGV = File::Find::Rule->name( "*.txt" )->in( "." ) } s/find/replace/'