perl -pe 'BEGIN{ $lines = 10 } last if $. > $lines' < file
Update: my perlgolf entry is:
--perl -pe'$.>10&&last' file
In reply to Re: Unix 'head' in perl
by edan
in thread Unix 'head' in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |