while (my $line = ) { if ( $. % 10 == 1 ) { print $line; } for (0 .. 3) { defined( my $important_line = ) or die("Premature EOF\n"); print $important_line; } }