in reply to Speed of opening and closing a file 1000s times

The first code fragment (which I think belongs to your second alternative) should be faster. Not only because you do less in the inner loop, but you allow far more filesystem caching *and* perl doesn't need to compile a new regex at each inner iteration.

Abigail

  • Comment on Re: Speed of opening and closing a file 1000s times