#!/usr/bin/perl use strict; use warnings; open FILE, 'file.1.dat'; my $hist = {map{ chomp; $_ => 1 } @{[]}}; close FILE; open FILE, 'file.2.dat'; while ( my $line = ) { chomp( $line ); my ( $file, $account, @other ) = split( /\t/, $line ); next if ( exists( $hist->{$account} ) ); print "$account:\t$file\n"; } close FILE; exit; __END__