sub common { my $sep=''; $sep |= $_ for map /:+/g, @_; $sep="<$sep:>"; local $_=join $sep, @_; /^(.*)(.*)$sep\1(.*)/; }