Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: ignore duplicates and show unique values between 2 text files

by Khen1950fx (Canon)
on Apr 29, 2013 at 17:06 UTC ( #1031260=note: print w/ replies, xml ) Need Help??


in reply to ignore duplicates and show unique values between 2 text files

An easier way is to use List::Compare:

#!/usr/bin/perl -l use strict; use warnings; use List::Compare; my (@Llist) = qw(abc def 121 xyz); my (@Rlist) = qw(def 121); my $lc = List::Compare->new( \@Llist, \@Rlist ); my (@sdiff) = $lc->get_symmetric_difference; foreach my $sdiff(@sdiff) { print $sdiff; }


Comment on Re: ignore duplicates and show unique values between 2 text files
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031260]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-12-19 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (78 votes), past polls