Hello Friends,

I was just writing some code and observed that :

My ($cur_line) = <IN>;

While ($cur_line = <IN>)
{
.........


Even though <IN> is a handle of a file with many lines, control does not
enter the while loop.

However when I do :

My ($cur_line);

$cur_line  = <IN>;

While ($cur_line = <IN>)
{
.........

It enters the while loop as I preseume it should.

Why is it so ? Value of $cur_line is the same before the while loop i.e.
only 1 line is read into the variable in both the cases.

Thanx
Aman

Reply via email to