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