Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: What's the right way to write a method which returns one line at a time from a file?

by AnomalousMonk (Archbishop)
on Nov 22, 2020 at 07:08 UTC ( [id://11124006]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ( my $line = readline( $self->{file_handle} ) ) {
        return $line;
    } else {
        return;
    }
    
  2. or download this
    if (defined(my $line = readline( $self->{file_handle} ))) {
        return $line;
    } else {
        return;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124006]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found