Perl: Loop through a file and substitute

前端 未结 3 502
攒了一身酷
攒了一身酷 2021-01-05 18:21

I simply wanna read in a logfile, do a search and replace, and then write out the changes to that same logfile.

What\'s the best practice way of doing this in Perl?

3条回答
  •  感动是毒
    2021-01-05 18:45

    or you can use sed (I know... you asked about perl):

    sed -i 's/find/replace/g' 
    

提交回复
热议问题