Array::Utils man page on Pidora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Pidora logo
[printable version]

Utils(3)	      User Contributed Perl Documentation	      Utils(3)

NAME
       Array::Utils - small utils for array manipulation

SYNOPSIS
	       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 );

DESCRIPTION
       A small pure-perl module containing list manipulation routines. The
       module emerged because I was tired to include same utility routines in
       numerous projects.

FUNCTIONS
       "unique"
	   Returns an array of unique items in the arguments list.

       "intersect"
	   Returns an intersection of two arrays passed as arguments, keeping
	   the order of the second parameter. A nice side effect of this
	   function can be exploited in situations as:

		   @atreides = qw( Leto Paul Alia 'Leto II' );
		   @mylist = qw( Alia Leto );
		   @mylist = intersect( @mylist, @atreides );  # and @mylist is ordered as Leto,Alia

       "array_diff"
	   Return symmetric difference of two arrays passed as arguments.

       "array_minus"
	   Returns the difference of the passed arrays A and B (only those
	   array elements that exist in A and do not exist in B).  If an empty
	   array is returned, A is subset of B.

	   Function was proposed by Laszlo Forro <salmonix@gmail.com>.

BUGS
       None known yet

AUTHOR
       Sergei A. Fedorov <zmij@cpan.org>

       I will be happy to have your feedback about the module.

COPYRIGHT
       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.

WARRANTY
       This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.

perl v5.14.1			  2010-05-07			      Utils(3)
[top]

List of man pages available for Pidora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net