in reply to Re^2: Unix and Windows CRLF vs LF
in thread Unix and Windows CRLF vs LF
foreach will make a list out of the file's contents and then will iterate, so it will read the whole file into memory.
while has a small footprint since it goes through the contents line by line plus it terminates when the the condition will evaluate to false;with foreach you go through everything in the list