http://www.perlmonks.org?node_id=574018


in reply to Finding common substrings

use List::Compare; use caveat "I haven't tested this."; my @in_both = List::Compare->new([split /\s+/, $a], [split /\s+/, $b]) +->get_intersection;