This is sort of what I am wanting to do. At present mm returns nothing, while searchname returns the expected value. This is a perl script embedded in a web page. I have tried numerous approaches to this code but nothing seems to provide the results I desire. I think it is just a case of syntax.
# search for an item
if ($modtype eq "search") {
$searchname=$modname;
print "Value of searchname $searchname\n";
my @mm = grep{$searchname} @names;
print "Value of mm @mm\n";
if ($mm eq $searchname) {
print "$searchname found!\n";
}
else {
print "$searchname not Found\n";
}
}
@namesis or what$modtype,$searchnameetc are. Please provide a minimal reproducible example.