Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

s// All Files In Directory

by perl.j (Pilgrim)
on Apr 02, 2012 at 19:26 UTC ( #963094=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://963094]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-12-06 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?