#!/usr/local/bin/perl -w use Exception; use strict; use warnings; use English; use FileHandle; my $master = shift; my $completed = shift; open(MASTER, "$master") || die "Unable to open $master file :$!\n"; #open(COMPLETE, "$completed") || die "Unable to open $completed file :$!\n"; # compare the two files and then print out # those in master file that are not in completed file if (! $completed || ! -e $completed) { die new Exception("Unable to open $completed file :$!\n"); } warn "# Reading 'COMPLETED' data"; my $hComData = getComData($completed); warn "# Got 'COMPLETED' data: ".scalar (keys %$hComData); # lets go though file while() { my @entries = split(/\n/, $_); my $entry = $entries[0]; # lets do a test print here #print "$entry\n"; my $h = $hComData->{$entry}; if(!$h) { print "$entry\n"; } #else #{ #print "$entry\n"; #} } ################################# sub getComData { my ($fIn) = @ARG; my $fh = new FileHandle($fIn) or die ""; my $hData = {}; my $check = 1; while (my $line = $fh->getline) { my @cols = split(/\n/,$line); #print "test $cols[0]\n"; my $hEntry = { 'chain' => $cols[0], 'exists' => $check++, }; #print "$check\n"; my ($chn, $ex) = sort ($hEntry->{chain}, $hEntry->{exists}); $hData->{$chn} = $hEntry; } return $hData; } #### 1ab4A 1ao8A 1aoeA 1bjtA 1jkxA 1juvA 1mejA 1meoA 1n0uA 1obhA 1pjqA 1qzfA #### 1ab4A 1aoeA 1bjtA 1obhA 1qzfA #### 1ab4A 1ao8A 1jkxA 1juvA 1mejA 1meoA 1n0uA 1pjqA