Perl uses buffered IO to read from any file. This means that a while (<FILE>){} line will read the file line by line from start to finish as fast as possible. Furthermore, because you want 100 lines of data, your code still has to scan every character in the data to discover 100 linefeeds.
Reading the file into memory to process it is useful if you need to process the same data multiple times. You can do this by slurping the data straight into an array.
In reply to Re: reading 100 line at a one time
by inman
in thread reading 100 line at a one time
by contact_chatan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |