while () { next unless $. > 3; last if $. == 22; print; # oder sonst was ... }