#!usr/bin/perl use strict; open FILE, "<$ARGV[0]"; # $ARGV[0] is the file name # to pass in in the command line. my $i=1; while (<FILE>) { if ($i >10) { last;} print $_ ; $i++; } close FILE;
In reply to Re: Reading in the first 10 lines of a file
by Benne
in thread Reading in the first 10 lines of a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |