Hi,
I am trying to find a string that matches in a file.
Here is the code I have so far:
$find = "string";
open FILE, "<file.txt";
while(<FILE>)
{
if ($_ =~ /$find/)
{
$RES = "YES";
}
else
{
$RES = "NO";
}
}
close(FILE);
The string is present in the file and I am not getting the right answer. Please help
Thanks
I am trying to find a string that matches in a file.
Here is the code I have so far:
$find = "string";
open FILE, "<file.txt";
while(<FILE>)
{
if ($_ =~ /$find/)
{
$RES = "YES";
}
else
{
$RES = "NO";
}
}
close(FILE);
The string is present in the file and I am not getting the right answer. Please help
Thanks