http://qs1969.pair.com?node_id=99278


in reply to File Input and Output

How come this never displays "Yes!" ? input.dat:
fred 20.4 harv 5.6 tony 5.13 dennis 401.1
My code:
open(FILE, "input.dat"); @list; while(<FILE>) { chomp; push @list, $_; } $i="harv"; $loc=-1; $cnt=0; foreach $list(@list) { if($i eq $list) { print "YES!\n"; } }

Edit kudra, 2001-07-25 Changed title