it always goes to the else , why ????data ---- one two three three one two one one three my %currentData; open (DATA, "data") or die ""; my $line; while ($line = <DATA>) { chomp $line; $currentData{$line}++; } close DATA; # Now after reading the user inputs for updating the file as follow my @updateInfo; my @updateInfo = "$inputONE\t$inputTwo\t$inputThree"; if ( $currentData{$line} ) { print "the info exists already\n"; exit; +} else { print " your info is being saved and the file is updated\n"; ex +it; }
In reply to Hash problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |