I don't expect the minds of mere mortal to comprehend my infinite knowledgeI don't agree with this.
And I don't understand this. ;)
;) (Tongue firmly in cheek)
Yeah, you know us pesky mortals.
If you're going to work with the lines one at a time anyway, what exactly is the advantage of using the probably slower and definitely more memory wasteful foreach()?
Your are right. I am not sure what I was thinking. I think I am still
contaminated from news years. I always use while. What threw me off was the
while (defined... why have the defined function there. Either way it will
iterate until EOF correct?
It handles the fairly unlikely special case of the last line of a file containing just 0, without a \n. That line would get read in, evaluate to Perl's definition of false and thus end the loop without processing the last line. Perl does this automagically when it fills $_ for a:
while (<FILE>) { }
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>