develooper Front page | perl.beginners | Postings from May 2007

Re: if (<FH>) VS while (<FH>)

Thread Previous | Thread Next
Tom Phoenix
May 29, 2007 07:16
Re: if (<FH>) VS while (<FH>)
Message ID:
On 29 May 2007 06:29:55 -0700, jeevs <> wrote:

> If (<FH>) ::: if doesn't not fill the $_ variable with contents of
> files first line automatically.

It doesn't happen automatically, but you can do it manually. Do you want this?

  if (defined($_ = <FH>)) { ... }

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About