in reply to Re^4: NON Common Elements between two columns
in thread NON Common Elements between two columns

Try this code:
#!/usr/bin/perl use warnings; use strict; # firstly, put all data in hashes because it's easier to look for data + in a hash my @input = ({},{}); # 2 hash references my @output; while (<>) { # this means: <STDIN> and/or filenames from @ARGV if (/^>([^\s]+)(\s+)?([^\s]+)?$/) { ++$input[0]->{$1}; # first match is an element of 1st +column defined $3 && ++$input[1]->{$3}; # third match might n +ot exist and belongs to 2nd column } } # secondly, loop over first hash searching for elements in second hash for (keys %{$input[0]}) { unless (exists ${$input[1]}{$_}) { push @output,$_; } } print join "\n",@output;
Sorry if my advice was wrong.