Hey i have a program where i needed to determine if something didnt match.
I originally tried using !=~ but no matter how many times i entered the string to match, it wouldnt work. i eventually replaced it with the not on the outside of the match and it now works. I would like to know why did !=~ fail to do what i wanted.
This doesnt Work
$k = ""
while ($k !=~ /hello/i)
{
$k = <STDIN>;
}
This Works
$k = ""
while (!($k =~ /hello/i))
{
$k = <STDIN>;
}
My question is whats the difference