Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by Plankton (Vicar)
on May 20, 2011 at 07:00 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://905871]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found