sub DoSomethingWithFile { my $FH = shift @_; while (){ # do stuff here } }