if (match_all($str, split(/\s+/, $search_str))) { print "All of them matched\n"; }