#!/usr/bin/perl use strict; use warnings; my %result; my @counts=(); foreach (@ARGV) { my $column=0; open my A, "<", "@counts "could not open file1 $!"; while () { chomp; my $key = (split /\t/, $_)[0]; $result{$key} = 1; $result{$key}++; if ($result{$key} == 20 { print "Line with $key is present in all twenty \n"; } } close (A); }; foreach (@counts) { s/^\s//g; print $_,"\n"; };