Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: help with a function that will cut out redundancy across two lists

by Plankton (Priest)
on May 20, 2011 at 07:00 UTC ( #905871=note: print w/ replies, xml ) Need Help??


in reply to help with a function that will cut out redundancy across two lists

I think you want to do something like this ...
plankton@ubuntu:~$ cat seen.pl #!/usr/bin/perl -w use strict; my %seen; while(<>) { chomp; $seen{$_}++; } for my $name ( keys %seen ) { print "$name\n"; } plankton@ubuntu:~$ cat names1 delbert james t kirk lisa simpson george of the jungle molly plankton@ubuntu:~$ cat names2 adolf albert molly fortran plankton@ubuntu:~$ ./seen.pl names1 names2 albert molly james t kirk george of the jungle adolf delbert lisa simpson fortran
... right?
  • Comment on Re: help with a function that will cut out redundancy across two lists
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2016-06-27 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (337 votes). Check out past polls.