Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 chanting in the Monastery: (4)
As of 2015-07-05 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls