use strict; use warnings; open(FILE, "<", "test.dat"); while () { print if 2 .. 4; } print "=====\n"; open(FILE, "<", "test.dat"); while () { print if 2 .. 4; } ====input==== one two three four five ====output==== two three four =====