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

Re: Difference between two arrays - is there a better way?

by Khen1950fx (Canon)
on Aug 09, 2011 at 12:45 UTC ( #919465=note: print w/replies, xml ) Need Help??


in reply to Difference between two arrays - is there a better way?

Instead of a diff, try finding unique users---the users who are still active. Using List::Compare:
#!/usr/bin/perl use strict; use warnings; use List::Compare; use Data::Dump qw(dump); my @list1 = qw(1 2 3 4 5); my @list2 = qw(2 3 4); my $lc = List::Compare->new(\@list1, \@list2); print "Disabled users: ", dump($lc->get_intersection), "\n"; print "Active users: ", dump($lc->get_unique), "\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2019-10-14 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?