most of the time... when a file is closed, even it's one line, a newline character is appended if there isn't one.
replace: $winner = <RSTDATA>; with : chomp($winner = <RSTDATA>); and you should be good. > -----Original Message----- > From: Glenn Cannon [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 05, 2002 3:57 PM > To: [EMAIL PROTECTED] > Subject: Problem testing variable > > > open (RSTDATA, "rst/r".$event.".rst")|| print "Oops"; > $winner = <RSTDATA>; > if ($winner eq "na") > { > print "Finalists<br>Did Not Play"; > } > else > { > print $winner; > } > > Why does the above code always print the value of $winner, and never > Finalists<br>Did Not Play, even when the line of text in the file is > just the letters na? > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]