if (<FH>) VS while (<FH>)
- From: jeevan.ingale@xxxxxxxxx (Jeevs)
- Date: 29 May 2007 06:29:55 -0700
If (<FH>) ::: if doesn't not fill the $_ variable with contents of
files first line automatically.
While (<FH>) ::: while do fill the $_ to content of the files first
line automatically.
i.e
open FH, "name.txt" or die "cant open";
if (<FH>){
print "$_";
}
prints nothing
If we change if to while $_ is set to first line of the file... how
can this happen
.
- Follow-Ups:
- Re: if (<FH>) VS while (<FH>)
- From: Paul Lalli
- Re: if (<FH>) VS while (<FH>)
- From: Tom Phoenix
- Re: if (<FH>) VS while (<FH>)
- Prev by Date: Re: Error with Html code
- Next by Date: Re: Array of Array refs
- Previous by thread: Error with Html code
- Next by thread: Re: if (<FH>) VS while (<FH>)
- Index(es):