in reply to Re: Perl: How to print unmatched data after comparison of two files?
in thread Perl: How to print unmatched data after comparison of two files?

Hi Loops, Thanks! =) I am sorry for my mistake. I updated the expected result. I would like to print out those unmatched data. How to print after name matching?
  • Comment on Re^2: Perl: How to print unmatched data after comparison of two files?

Replies are listed 'Best First'.
Re^3: Perl: How to print unmatched data after comparison of two files?
by Loops (Curate) on Jul 17, 2013 at 06:58 UTC

    No worries, you just need to reverse the test that decides which lines to print. One way is to change the if statement to an "unless" statement.

    print "$_\n" unless exists $ids{$id};
      Yes It works perfectly. Thanks for your guidance. =)