in reply to Re: Reading in the first 10 lines of a file
in thread Reading in the first 10 lines of a file

Not recommended! Slurps the entire file into memory...
  • Comment on Re^2: Reading in the first 10 lines of a file

Replies are listed 'Best First'.
Re^3: Reading in the first 10 lines of a file
by CountZero (Bishop) on Dec 11, 2011 at 11:24 UTC
    Yes, I know.

    Memory is plenty and cheap :) and my fingers are clumsy and lazy :D

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James