Utils(3pm) | User Contributed Perl Documentation | Utils(3pm) |
Array::Utils - small utils for array manipulation
use Array::Utils qw(:all); my @a = qw( a b c d ); my @b = qw( c d e f ); # symmetric difference my @diff = array_diff(@a, @b); # intersection my @isect = intersect(@a, @b); # unique union my @unique = unique(@a, @b); # check if arrays contain same members if ( !array_diff(@a, @b) ) { # do something } # get items from array @a that are not in array @b my @minus = array_minus( @a, @b );
A small pure-perl module containing list manipulation routines. The module emerged because I was tired to include same utility routines in numerous projects.
@atreides = qw( Leto Paul Alia 'Leto II' ); @mylist = qw( Alia Leto ); @mylist = intersect( @mylist, @atreides ); # and @mylist is ordered as Leto,Alia
Function was proposed by Laszlo Forro <salmonix@gmail.com>.
None known yet
Sergei A. Fedorov <zmij@cpan.org>
I will be happy to have your feedback about the module.
This module is Copyright (c) 2007 Sergei A. Fedorov. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.
2022-10-15 | perl v5.36.0 |