Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Difference between two arrays - is there a better way?

by blindluke (Hermit)
on Aug 09, 2011 at 08:58 UTC ( #919422=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    for (keys %repeats) {
        push @diff, $_ unless $repeats{$_} > 1;
    }
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    @diff{ @list1 } = undef;
    delete @diff{ @list2 };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://919422]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2019-02-19 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I use postfix dereferencing ...









    Results (101 votes). Check out past polls.

    Notices?