Keep It Simple, Stupid | |
PerlMonks |
Re^3: What's the right way to write a method which returns one line at a time from a file?by bliako (Monsignor) |
on Nov 22, 2020 at 09:48 UTC ( [id://11124012]=note: print w/replies, xml ) | Need Help?? |
$self->{file_handle} = $self->get_filehandle( $self->{file} );
You can't reload or open a new file using the above. Additionally, you can end up having a discrepancy whereas $self->{file} points to one file and $self->{file_handle} to another. If you want that functionality, then I would set file_handle inside get_filehandle() with appropriate logic.
In Section
Seekers of Perl Wisdom
|
|