http://qs1969.pair.com?node_id=963094

perl.j has asked for the wisdom of the Perl Monks concerning the following question:

Hello!

So here is my problem: I want to go through all of the file in a directory, and s/5/6/.

How can I open all of the file in the directory, and substitute all of the 5s for 6s?

--perl.j

Replies are listed 'Best First'.
Re: s// All Files In Directory
by Happy-the-monk (Canon) on Apr 02, 2012 at 19:37 UTC

    How can I open all of the file in the directory, and substitute all of the 5s for 6s?

    perldoc perlrun yields the answer to your question. Have a look for -pi.

    Cheers, Sören

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: s// All Files In Directory
by Anonymous Monk on Apr 02, 2012 at 19:34 UTC