while (<>) { do_something($_) if (6..eof()); } #### while (<>) { next if (1..5); # Whatever here }