in reply to Comparision Utility PERL

#!/usr/bin/perl # http://perlmonks.org/?node_id=1208783 use strict; use warnings; my ($match, $input, $output, $colmatch, $colinput) = @ARGV == 5 ? @AR +GV : qw( d.file1 d.file2 d.output 2 3 ); # for testing, replace with usag +e my %matchs = map { s/^\s+|\s+$//gr, 1 } grep defined, map +(split /\|/)[$colmatch - 1], do { local @ARGV = $match; <> }; open my $fh, '>', $output or die "$! opening $output"; print $fh grep $matchs{ ((split /\|/)[$colinput - 1] // '') =~ s/^\s+|\s+$//gr + }, do { local @ARGV = $input; <> }; close $fh;