open(FH, $opts{-file}); $opts{-handle} = \*FH; $parser->from_handle(%opts); #### sub from_handle { my $self = shift; my %opts = @_; while (<$opts{-handle}>) { #... and here we're supposed to read from FH } }