Using /filter or $fopen and $fread are generally better than looping $read statements.

/filter, if set up correctly, should only need to open the file once. $fopen and $fread will open the file until you close it, and would generally be easier to use in a script.