I need to find whether a value is present in a string or not using grep in if condition. I tried few code but that was incorrect
This is for windows running Perl.
$string ="This is a test string";
$val ="test";
if( grep /$val/i, $string)
print "found";
else
print "not found";
I expect the output to be found