use strict; sub test { local *FH = shift; while () {print;} } open FILE,'<',$0 or die $!; test(*FILE); close FILE;