basically i am trying to search for similar strings in an array which is hardcoded into the script and compare them to and find the line they exist on the text file
here is my code so far
#!/usr/bin/perl
%fruit=(banana=>1,apple=>2,orange=>5);
$target = %fruit;
open(INPUT, "<fruits.txt");
while (<INPUT>) {
if (/$target/) {
print "Found $target on line $.";
}
}
close(INPUT);
I have attached the file which i am to search .