#!/usr/bin/perl use strict; use List::Vectorize; my $sets = []; for (@ARGV) { open F, $_ or die "cannot open $_"; push(@$sets, [ ]); close F; } print join "", @{intersect(@$sets)};