Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: How to repeat a string multiple times if found match

by haukex (Archbishop)
on Mar 09, 2021 at 08:04 UTC ( [id://11129363]=note: print w/replies, xml ) Need Help??


in reply to Re: How to repeat a string multiple times if found match
in thread How to repeat a string multiple times if found match

Usual practice is to create an output file to write the updated content to, then after the update is complete delete the old file and rename the new version to the name of the old version.

suvendra123: You may be interested in my module File::Replace to help you with this.

  • Comment on Re^2: How to repeat a string multiple times if found match

Replies are listed 'Best First'.
Re^3: How to repeat a string multiple times if found match
by suvendra123 (Initiate) on Mar 09, 2021 at 10:27 UTC
    I don't want foo_ foo line only
    foo_1 foo_2 foo_3
      I don't want foo_ foo line only foo_1 foo_2 foo_3

      Please compare your code to the code I gave you here.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-19 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found