[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Only read the first 30 lines of a file?



At 04.53 -0400 1999.04.23, Peter Westlake wrote:
>>for (0..30) {
>>  $data .= <FILE>;
>>}
>
>1..30, surely? Both endpoints are included in the range,
>according to "Programming perl".

Yeah, that gives 31 lines.  As long as the lines aren't a megabyte long, it
shouldn't pose a problem for him.  :)

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org