$A = 'dog'; $B = 'doghouse'; if($B =~ /$A/){ return "found"; } else{ return "not found!"; }