good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Print contents of text file line by lineby Anonymous Monk |
on Jun 24, 2018 at 23:47 UTC ( [id://1217337]=note: print w/replies, xml ) | Need Help?? |
Unless you really want to print only selected lines of the file, you probably should use the line-by-line approach that you currently (unintentionally) wrote, and add a counter of the number of times this loop has executed, and end the loop after you have printed enough. This will work for any file regardless of size.
In Section
Seekers of Perl Wisdom
|
|