sub chunk_at_a_time { my $FH = IO::File->new ... my $func_ref = shift; my @func_args = @_; until ( $FH->eof ) { &{$func_ref}(@func_args); } } ... My_Module::chunk_at_a_time( @file_args, \&some_sub_name, @sub_args);