Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Best way to edit a file?by cdarke (Prior) |
on Apr 02, 2007 at 13:32 UTC ( [id://607819]=note: print w/replies, xml ) | Need Help?? |
You could open the file for read and write, find the line of interest, seek backwards to start of line, then overwrite it. BUT, I agree with MonkE. Text files lines are usually variable length. This means that for the single file approach to work the new line must be exactly the same length as the original.
In Section
Seekers of Perl Wisdom
|
|