my $first_line_to_show = 427; open VIEWFILE, "< $path" or die "Can't open $path: $!\n"; while( my $v_file = ) { next if $. < $first_line_to_show - 1; last if $. >= $first_line_to_show + 100; print "$v_file"; } close VIEWFILE;