Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
No warnings, no strictures. Bad. You should always, yes, always, check the results of system calls for errors.
There is absolutely no need in any of the examples to read the file into an array. It is faster and far less memory wasteful to loop through the file with while:
In your 3rd example, you are not opening the file for writing, so writing will fail. This would have been caught if you had allowed warnings. There are more problems, but since many posts above have dealt with this problem much better, I will cease now.
In reply to Re: Re: write exact lines of file
by helgi
|
|