use match::simple 'match'; foobar() if match $needle, $haystack;