open my $FH, '<', $ARGV[0] or die $!; 1 while <$FH>; $line_count = $.; seek $FH, $. = 0, 0;