while(<>) { print if 1 .. 5; #Print lines 1 trough 5 including. }