in reply to File Input and Output
How come this never displays "Yes!" ?
input.dat:
My code:fred 20.4 harv 5.6 tony 5.13 dennis 401.1
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
In Section
Tutorials