gudn tach!
mit dem stichwort "intersection" findest du recht fix algorithmen dazu:
z.b.
http://www.unix.org.ua/orelly/perl/cookbook/ch04_09.htm
http://www.chovy.com/perl/finding-an-intersection-between-arrays-in-perl/
oder in speziellen faellen
http://search.cpan.org/dist/Set-IntSpan-Fast/lib/Set/IntSpan/Fast.pm
prost
seth