note
AnomalousMonk
<blockquote><i>
<c>
if ( my $line = readline( $self->{file_handle} ) ) {
return $line;
} else {
return;
}
</c>
</i></blockquote>
<p>
I appreciate old-school, but I think the quoted code will fail to
return the last line of a file if it is <c>'0'</c> with no
terminating newline. I haven't tested it, but wouldn't
<c>
if (defined(my $line = readline( $self->{file_handle} ))) {
return $line;
} else {
return;
}
</c>
or even just <br>
<c> return readline($self->{file_handle});</c> <br>
([doc://readline] returns [doc://undef] at eof) be better?
</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-634253">
<hr><p>Give a man a fish<b>:</B> <c> <%-{-{-{-<</C></P>
</div></div>
11124000
11124005