in reply to File slurping efficiency
In cases like this, I usually go with whichever method makes parsing easier. If it's line based, I loop over the array (or use while on the filehandle). If I'm dealing with something that can span lines, I'll try the second (or redefine $/).
If you're only looking for the first instance of the string in the file, and you're only concerned with what else is on the line, I'd go with while. Without seeing your data or knowing more about it, it's hard to say more.
|
|---|