$a = "Hello(world)"; $b = shift(@a); if ($a =~ /$b/o) { print "Matched!\n"; }