Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl Monk, Perl Meditation
 
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 making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-04-19 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls