if ($form{searchtype} eq "keyword") { #check that what was filled in the form was right if ($class =~ /keyword/) { #Check the class is type keyword if ($desc =~ /$form{'searchstring'}/i) { #Make sure the string is in $desc if ($desc =~ /$form{'searchprice'}/) { #Check for price in $desc print "$desc\n"; } } } } #### if (($form{'searchtype'} eq "keyword") && ($class =~ /keyword/) && ($desc =~ /$form{'searchstring'}/i) && ($desc =~ /$form{'searchprice'}/)) { print "$desc\n"; }