Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

s// All Files In Directory

by perl.j (Pilgrim)
on Apr 02, 2012 at 19:26 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-18 03:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found