Work code:
if ( $check1 eq $search_key ...
Previous 'buggy' code:
if ( $check1 =~ /$search_key/ ...
Words (in $check1 and $search_key ) should be the same, but why doesn't the second one return true all the time? What is their difference?
$check1 obtained through a split. $search_key either entered before ("word"), or at runtime: ( <> ), then both are passed to the subroutine.
One more question: is it possible to convert the following without any hidden problems?
if ($category_id eq "subj") {
I want to be able to say: =~ /subj/ so that the "object" is still true.
Thanks in advance.
source share