good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello my monkish friends,
I'm trying to find a simple and efficent way to: 1) Read a line from a file 1b) Do stuff.... 2) Edit that line 3) Write it back to file in the same location (overwrite) 4) Repeat for next line, etc. I know I can open(my $fh, "+<< $file") to open my file in read/append mode. I also know that I can use seek() to jump around in the file, though my actual use of it hasn't been much. Any advice here? Thanks, ibanix $ echo '$0 & $0 &' > foo; chmod a+x foo; foo; In reply to In-place file manipulation by ibanix
|
|