#!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 () { if ($i >2) { last;} print $_ ; $i++; } close FILE;