If you have a lock on the file, you can then release it.
I had considered that possibility. That would be
@a = <$fh>; close $fh; for (@a) { .. }
There are reasons to load the file into an array. That's one of them, and I listed four others. But that's not the code the OP posted, and that's not the code I proclaimed should be avoided. You did not contradict me, or do you think I've already contradicted myself four times?
In reply to Re^5: foreach vs while<>
by ikegami
in thread foreach vs while<>
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |