in reply to Re^3: Moose reading file line by line
in thread Moose reading big file line by line

You are right in everything you have written. So to make it work should I make a reference to $fh and that reference to be $self->handler?

Replies are listed 'Best First'.
Re^5: Moose reading file line by line
by Corion (Patriarch) on Apr 27, 2015 at 13:45 UTC

    I would simply use whatever Moose allows as getters and setters and use the setter to store the filehandle:

    sub openHandler { open my $fh, '<', $filename or die "$filename: $!"; $self->set_filehandle($fh); };