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

Re: what happens to the rest of a file piped to head/tail?




I said:
> cat file | perl -e 'while (<>) { print if (++$count>20); }'

Someone has pointed out to me that this is equivalent to

    cat file | perl -e 'while (<>) { print if ($.>20); }'

I always forget about some of those built-in perl variables...

Steve
-- 
steve@silug.org           | Linux Users of Central Illinois
(217)698-1694             | Meetings the 4th Tuesday of every month
Steven Pritchard          | http://www.luci.org/ for more info

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.