[tpm] Filehandle $fh opened only for output at ....

arocker at Vex.Net arocker at Vex.Net
Wed May 3 13:33:27 PDT 2017


>> > The code looks like
>> >         while ( my $bug = <$fh> ) {
>>
>> As I recall the idiom is `while (defined(my $foo = <$fh>))`
>>
>
> From what I recall the defined is added implicitly in simple = <...> loops
> like that (but may not be with more complex conditions). See:
>

Isn't the "defined" there to deal with the case where the expression
evaluates to a false value?


More information about the toronto-pm mailing list