in reply to Re^2: Odd behaviour with $. and <DATA>
in thread Odd behaviour with $. and <DATA>
Before foreach can iterate over the list, it needs to be built. It works the same way for function. A list must be built before it can be used. In this case, building the list means reading the entire file.
foreach (x..y) is an exception to this. That list is evaluated lazily.
|
|---|