open (FILE, $ARGV[0]) or die "Can't open '$ARGV[0]': $!"; $lines++ while (); close FILE; print "$lines\n";