in reply to deleting a line from a text file
Firstly, the code is iterating keys(%FORM) and doing a sweep of the file for each one. Note, the close brace for this is the second one on the line following print NEW; hence the rename doesn't happen until all keys have been processed (overwriting $file.new each time).
Secondly, your condition check does not depend on the text in the input file!
Finally, you should consider using strict and warnings. This will help you by catching many bugs at source. There are many nodes on PM that describe why strict and warnings are a good thing.if ($FORM{$key}==1) { $found =1; next; }
Hope this helps,
--
I'm Not Just Another Perl Hacker
|
|---|