Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Changing string in specific line/position in a file

by Corion (Patriarch)
on Oct 31, 2022 at 17:27 UTC ( [id://11147866]=note: print w/replies, xml ) Need Help??


in reply to Changing string in specific line/position in a file

Maybe Tie::File is what you want? That allows you to treat a file as if it were an array of lines.

In the background, it still needs to rewrite the whole file, because if you change the length of a line while replacing stuff, the rest of the file needs to be adjusted.

  • Comment on Re: Changing string in specific line/position in a file

Replies are listed 'Best First'.
Re^2: Changing string in specific line/position in a file
by onemojofilter (Novice) on Oct 31, 2022 at 18:00 UTC
    Thanks! I'll check it out.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2025-02-14 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found