Daniel (>), Leon (>>), Daniel (>>>):
>>> Then why is it that .get works fine for $*IN?
>>>
>>> while $*IN.get -> $line {
>>>       say $line
>>> }
>>>
>>
>> Because you're using a while loop instead of a for loop ;-)
>
> Worse. The code I wrote has a subtle but horrible error. The condition will
> fail as soon as you hit a blank line!!

Which, I think, summarizes why the 'for $*IN.lines' idiom is preferred
in Perl 6.

// Carl

Reply via email to