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

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

Thread Previous | Thread Next
From:
Tom Phoenix
Date:
May 29, 2007 07:16
Subject:
Re: if (<FH>) VS while (<FH>)
Message ID:
31086b240705290715w16a15b03pe6dc8d4e04650f1a@mail.gmail.com
On 29 May 2007 06:29:55 -0700, jeevs <jeevan.ingale@gmail.com> 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About