Okay, I admit that opening a file 14334 times to see if it has a line matching the current item may not be the most efficient thing to do. In hindsight, reading the whole 2396 line data set (432 Kb) into memory might have been a better thing to do. *Taps watch
(
Read more... )
Comments 1
$found = "1", if /^($item):text/i;
...is perl smart enough to stop searching if the first letter is not 'f'? (I suspect that it is, but also that it makes little difference, as the cost comes from reading from the file, not comparing strings in memory.)
Reply
Leave a comment