You are overlaying $line each time you read a line from <>. SO it will be
the last line from whatever files if any were passed.

Wags ;)

-----Original Message-----
From: Bob Mangold [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 19, 2001 13:25
To: [EMAIL PROTECTED]
Subject: variable losing it's value


I may have a bug somewhere in my code, but I can't find it. Before I look
again
though please answer this for me.

If I execute:


my ($line) = "hello";
foreach $line (<>){
     ..... whatever
}
print $line;


Should it print the last line in <> or 'hello'? 

-Bob

__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

Reply via email to