my $first = shift || die "first file\n"; my $sec = shift || die "second\n"; #### #!/usr/bin/perl use strict; use warnings; my $first = shift or die "first file\n"; my $sec = shift or die "second\n"; open my $FIRST, '<', $first or die "$first: $!"; open my $SEC, '<', $sec or die "$sec: $!"; print "processing $first\n"; my %common = map { /^\s*(\?.*?)\s/, 0 } <$FIRST>; print "processing $sec\n"; /^\s*(\?.*?)\s/ and $common{ $1 }++ while <$SEC>; print "finding common keys\n"; delete @common{ grep !$common{ $_ }, keys %common }; print "there are @{[scalar keys %common]}:\n"; system 'pause'; for my $key ( keys %common ) { print "\n\n\n$key\n\n\n"; }