use strict; use warnings; my $target = "cowboycatdog"; my @parts = qw(cow cowboy boy cat at do dog); search ($target, [@parts], []);