.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
.    if \nF \{
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "List::MoreUtils 3"
.TH List::MoreUtils 3 "2011-08-04" "perl v5.16.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
List::MoreUtils \- Provide the stuff missing in List::Util
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 11
\&    use List::MoreUtils qw{
\&        any all none notall true false
\&        firstidx first_index lastidx last_index
\&        insert_after insert_after_string
\&        apply indexes
\&        after after_incl before before_incl
\&        firstval first_value lastval last_value
\&        each_array each_arrayref
\&        pairwise natatime
\&        mesh zip uniq distinct minmax part
\&    };
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBList::MoreUtils\fR provides some trivial but commonly needed functionality on
lists which is not going to go into List::Util.
.PP
All of the below functions are implementable in only a couple of lines of Perl
code. Using the functions from this module however should give slightly better
performance as everything is implemented in C. The pure-Perl implementation of
these functions only serves as a fallback in case the C portions of this module
couldn't be compiled on this machine.
.IP "any \s-1BLOCK LIST\s0" 4
.IX Item "any BLOCK LIST"
Returns a true value if any item in \s-1LIST\s0 meets the criterion given through
\&\s-1BLOCK.\s0 Sets \f(CW$_\fR for each item in \s-1LIST\s0 in turn:
.Sp
.Vb 2
\&    print "At least one value undefined"
\&        if any { ! defined($_) } @list;
.Ve
.Sp
Returns false otherwise, or if \s-1LIST\s0 is empty.
.IP "all \s-1BLOCK LIST\s0" 4
.IX Item "all BLOCK LIST"
Returns a true value if all items in \s-1LIST\s0 meet the criterion given through
\&\s-1BLOCK,\s0 or if \s-1LIST\s0 is empty. Sets \f(CW$_\fR for each item in \s-1LIST\s0 in turn:
.Sp
.Vb 2
\&    print "All items defined"
\&        if all { defined($_) } @list;
.Ve
.Sp
Returns false otherwise.
.IP "none \s-1BLOCK LIST\s0" 4
.IX Item "none BLOCK LIST"
Logically the negation of \f(CW\*(C`any\*(C'\fR. Returns a true value if no item in \s-1LIST\s0 meets
the criterion given through \s-1BLOCK,\s0 or if \s-1LIST\s0 is empty. Sets \f(CW$_\fR for each item
in \s-1LIST\s0 in turn:
.Sp
.Vb 2
\&    print "No value defined"
\&        if none { defined($_) } @list;
.Ve
.Sp
Returns false otherwise.
.IP "notall \s-1BLOCK LIST\s0" 4
.IX Item "notall BLOCK LIST"
Logically the negation of \f(CW\*(C`all\*(C'\fR. Returns a true value if not all items in \s-1LIST\s0
meet the criterion given through \s-1BLOCK.\s0 Sets \f(CW$_\fR for each item in \s-1LIST\s0 in
turn:
.Sp
.Vb 2
\&    print "Not all values defined"
\&        if notall { defined($_) } @list;
.Ve
.Sp
Returns false otherwise, or if \s-1LIST\s0 is empty.
.IP "true \s-1BLOCK LIST\s0" 4
.IX Item "true BLOCK LIST"
Counts the number of elements in \s-1LIST\s0 for which the criterion in \s-1BLOCK\s0 is true.
Sets \f(CW$_\fR for  each item in \s-1LIST\s0 in turn:
.Sp
.Vb 1
\&    printf "%i item(s) are defined", true { defined($_) } @list;
.Ve
.IP "false \s-1BLOCK LIST\s0" 4
.IX Item "false BLOCK LIST"
Counts the number of elements in \s-1LIST\s0 for which the criterion in \s-1BLOCK\s0 is false.
Sets \f(CW$_\fR for each item in \s-1LIST\s0 in turn:
.Sp
.Vb 1
\&    printf "%i item(s) are not defined", false { defined($_) } @list;
.Ve
.IP "firstidx \s-1BLOCK LIST\s0" 4
.IX Item "firstidx BLOCK LIST"
.PD 0
.IP "first_index \s-1BLOCK LIST\s0" 4
.IX Item "first_index BLOCK LIST"
.PD
Returns the index of the first element in \s-1LIST\s0 for which the criterion in \s-1BLOCK\s0
is true. Sets \f(CW$_\fR for each item in \s-1LIST\s0 in turn:
.Sp
.Vb 4
\&    my @list = (1, 4, 3, 2, 4, 6);
\&    printf "item with index %i in list is 4", firstidx { $_ == 4 } @list;
\&    _\|_END_\|_
\&    item with index 1 in list is 4
.Ve
.Sp
Returns \f(CW\*(C`\-1\*(C'\fR if no such item could be found.
.Sp
\&\f(CW\*(C`first_index\*(C'\fR is an alias for \f(CW\*(C`firstidx\*(C'\fR.
.IP "lastidx \s-1BLOCK LIST\s0" 4
.IX Item "lastidx BLOCK LIST"
.PD 0
.IP "last_index \s-1BLOCK LIST\s0" 4
.IX Item "last_index BLOCK LIST"
.PD
Returns the index of the last element in \s-1LIST\s0 for which the criterion in \s-1BLOCK\s0
is true. Sets \f(CW$_\fR for each item in \s-1LIST\s0 in turn:
.Sp
.Vb 4
\&    my @list = (1, 4, 3, 2, 4, 6);
\&    printf "item with index %i in list is 4", lastidx { $_ == 4 } @list;
\&    _\|_END_\|_
\&    item with index 4 in list is 4
.Ve
.Sp
Returns \f(CW\*(C`\-1\*(C'\fR if no such item could be found.
.Sp
\&\f(CW\*(C`last_index\*(C'\fR is an alias for \f(CW\*(C`lastidx\*(C'\fR.
.IP "insert_after \s-1BLOCK VALUE LIST\s0" 4
.IX Item "insert_after BLOCK VALUE LIST"
Inserts \s-1VALUE\s0 after the first item in \s-1LIST\s0 for which the criterion in \s-1BLOCK\s0 is
true. Sets \f(CW$_\fR for each item in \s-1LIST\s0 in turn.
.Sp
.Vb 5
\&    my @list = qw/This is a list/;
\&    insert_after { $_ eq "a" } "longer" => @list;
\&    print "@list";
\&    _\|_END_\|_
\&    This is a longer list
.Ve
.IP "insert_after_string \s-1STRING VALUE LIST\s0" 4
.IX Item "insert_after_string STRING VALUE LIST"
Inserts \s-1VALUE\s0 after the first item in \s-1LIST\s0 which is equal to \s-1STRING. \s0
.Sp
.Vb 5
\&    my @list = qw/This is a list/;
\&    insert_after_string "a", "longer" => @list;
\&    print "@list";
\&    _\|_END_\|_
\&    This is a longer list
.Ve
.IP "apply \s-1BLOCK LIST\s0" 4
.IX Item "apply BLOCK LIST"
Applies \s-1BLOCK\s0 to each item in \s-1LIST\s0 and returns a list of the values after \s-1BLOCK\s0
has been applied. In scalar context, the last element is returned.  This
function is similar to \f(CW\*(C`map\*(C'\fR but will not modify the elements of the input
list:
.Sp
.Vb 7
\&    my @list = (1 .. 4);
\&    my @mult = apply { $_ *= 2 } @list;
\&    print "\e@list = @list\en";
\&    print "\e@mult = @mult\en";
\&    _\|_END_\|_
\&    @list = 1 2 3 4
\&    @mult = 2 4 6 8
.Ve
.Sp
Think of it as syntactic sugar for
.Sp
.Vb 1
\&    for (my @mult = @list) { $_ *= 2 }
.Ve
.IP "before \s-1BLOCK LIST\s0" 4
.IX Item "before BLOCK LIST"
Returns a list of values of \s-1LIST\s0 upto (and not including) the point where \s-1BLOCK\s0
returns a true value. Sets \f(CW$_\fR for each element in \s-1LIST\s0 in turn.
.IP "before_incl \s-1BLOCK LIST\s0" 4
.IX Item "before_incl BLOCK LIST"
Same as \f(CW\*(C`before\*(C'\fR but also includes the element for which \s-1BLOCK\s0 is true.
.IP "after \s-1BLOCK LIST\s0" 4
.IX Item "after BLOCK LIST"
Returns a list of the values of \s-1LIST\s0 after (and not including) the point
where \s-1BLOCK\s0 returns a true value. Sets \f(CW$_\fR for each element in \s-1LIST\s0 in turn.
.Sp
.Vb 1
\&    @x = after { $_ % 5 == 0 } (1..9);    # returns 6, 7, 8, 9
.Ve
.IP "after_incl \s-1BLOCK LIST\s0" 4
.IX Item "after_incl BLOCK LIST"
Same as \f(CW\*(C`after\*(C'\fR but also inclues the element for which \s-1BLOCK\s0 is true.
.IP "indexes \s-1BLOCK LIST\s0" 4
.IX Item "indexes BLOCK LIST"
Evaluates \s-1BLOCK\s0 for each element in \s-1LIST \s0(assigned to \f(CW$_\fR) and returns a list
of the indices of those elements for which \s-1BLOCK\s0 returned a true value. This is
just like \f(CW\*(C`grep\*(C'\fR only that it returns indices instead of values:
.Sp
.Vb 1
\&    @x = indexes { $_ % 2 == 0 } (1..10);   # returns 1, 3, 5, 7, 9
.Ve
.IP "firstval \s-1BLOCK LIST\s0" 4
.IX Item "firstval BLOCK LIST"
.PD 0
.IP "first_value \s-1BLOCK LIST\s0" 4
.IX Item "first_value BLOCK LIST"
.PD
Returns the first element in \s-1LIST\s0 for which \s-1BLOCK\s0 evaluates to true. Each
element of \s-1LIST\s0 is set to \f(CW$_\fR in turn. Returns \f(CW\*(C`undef\*(C'\fR if no such element
has been found.
.Sp
\&\f(CW\*(C`first_val\*(C'\fR is an alias for \f(CW\*(C`firstval\*(C'\fR.
.IP "lastval \s-1BLOCK LIST\s0" 4
.IX Item "lastval BLOCK LIST"
.PD 0
.IP "last_value \s-1BLOCK LIST\s0" 4
.IX Item "last_value BLOCK LIST"
.PD
Returns the last value in \s-1LIST\s0 for which \s-1BLOCK\s0 evaluates to true. Each element
of \s-1LIST\s0 is set to \f(CW$_\fR in turn. Returns \f(CW\*(C`undef\*(C'\fR if no such element has been
found.
.Sp
\&\f(CW\*(C`last_val\*(C'\fR is an alias for \f(CW\*(C`lastval\*(C'\fR.
.IP "pairwise \s-1BLOCK ARRAY1 ARRAY2\s0" 4
.IX Item "pairwise BLOCK ARRAY1 ARRAY2"
Evaluates \s-1BLOCK\s0 for each pair of elements in \s-1ARRAY1\s0 and \s-1ARRAY2\s0 and returns a
new list consisting of \s-1BLOCK\s0's return values. The two elements are set to \f(CW$a\fR
and \f(CW$b\fR.  Note that those two are aliases to the original value so changing
them will modify the input arrays.
.Sp
.Vb 3
\&    @a = (1 .. 5);
\&    @b = (11 .. 15);
\&    @x = pairwise { $a + $b } @a, @b;   # returns 12, 14, 16, 18, 20
\&
\&    # mesh with pairwise
\&    @a = qw/a b c/;
\&    @b = qw/1 2 3/;
\&    @x = pairwise { ($a, $b) } @a, @b;  # returns a, 1, b, 2, c, 3
.Ve
.IP "each_array \s-1ARRAY1 ARRAY2 ...\s0" 4
.IX Item "each_array ARRAY1 ARRAY2 ..."
Creates an array iterator to return the elements of the list of arrays \s-1ARRAY1,
ARRAY2\s0 throughout ARRAYn in turn.  That is, the first time it is called, it
returns the first element of each array.  The next time, it returns the second
elements.  And so on, until all elements are exhausted.
.Sp
This is useful for looping over more than one array at once:
.Sp
.Vb 2
\&    my $ea = each_array(@a, @b, @c);
\&    while ( my ($a, $b, $c) = $ea\->() )   { .... }
.Ve
.Sp
The iterator returns the empty list when it reached the end of all arrays.
.Sp
If the iterator is passed an argument of '\f(CW\*(C`index\*(C'\fR', then it retuns
the index of the last fetched set of values, as a scalar.
.IP "each_arrayref \s-1LIST\s0" 4
.IX Item "each_arrayref LIST"
Like each_array, but the arguments are references to arrays, not the
plain arrays.
.IP "natatime \s-1EXPR, LIST\s0" 4
.IX Item "natatime EXPR, LIST"
Creates an array iterator, for looping over an array in chunks of
\&\f(CW$n\fR items at a time.  (n at a time, get it?).  An example is
probably a better explanation than I could give in words.
.Sp
Example:
.Sp
.Vb 6
\&    my @x = (\*(Aqa\*(Aq .. \*(Aqg\*(Aq);
\&    my $it = natatime 3, @x;
\&    while (my @vals = $it\->())
\&    {
\&        print "@vals\en";
\&    }
.Ve
.Sp
This prints
.Sp
.Vb 3
\&    a b c
\&    d e f
\&    g
.Ve
.IP "mesh \s-1ARRAY1 ARRAY2\s0 [ \s-1ARRAY3 ... \s0]" 4
.IX Item "mesh ARRAY1 ARRAY2 [ ARRAY3 ... ]"
.PD 0
.IP "zip \s-1ARRAY1 ARRAY2\s0 [ \s-1ARRAY3 ... \s0]" 4
.IX Item "zip ARRAY1 ARRAY2 [ ARRAY3 ... ]"
.PD
Returns a list consisting of the first elements of each array, then
the second, then the third, etc, until all arrays are exhausted.
.Sp
Examples:
.Sp
.Vb 3
\&    @x = qw/a b c d/;
\&    @y = qw/1 2 3 4/;
\&    @z = mesh @x, @y;       # returns a, 1, b, 2, c, 3, d, 4
\&
\&    @a = (\*(Aqx\*(Aq);
\&    @b = (\*(Aq1\*(Aq, \*(Aq2\*(Aq);
\&    @c = qw/zip zap zot/;
\&    @d = mesh @a, @b, @c;   # x, 1, zip, undef, 2, zap, undef, undef, zot
.Ve
.Sp
\&\f(CW\*(C`zip\*(C'\fR is an alias for \f(CW\*(C`mesh\*(C'\fR.
.IP "uniq \s-1LIST\s0" 4
.IX Item "uniq LIST"
.PD 0
.IP "distinct \s-1LIST\s0" 4
.IX Item "distinct LIST"
.PD
Returns a new list by stripping duplicate values in \s-1LIST.\s0 The order of
elements in the returned list is the same as in \s-1LIST.\s0 In scalar context,
returns the number of unique elements in \s-1LIST.\s0
.Sp
.Vb 2
\&    my @x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4
\&    my $x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 5
.Ve
.IP "minmax \s-1LIST\s0" 4
.IX Item "minmax LIST"
Calculates the minimum and maximum of \s-1LIST\s0 and returns a two element list with
the first element being the minimum and the second the maximum. Returns the
empty list if \s-1LIST\s0 was empty.
.Sp
The \f(CW\*(C`minmax\*(C'\fR algorithm differs from a naive iteration over the list where each
element is compared to two values being the so far calculated min and max value
in that it only requires 3n/2 \- 2 comparisons. Thus it is the most efficient
possible algorithm.
.Sp
However, the Perl implementation of it has some overhead simply due to the fact
that there are more lines of Perl code involved. Therefore, \s-1LIST\s0 needs to be
fairly big in order for \f(CW\*(C`minmax\*(C'\fR to win over a naive implementation. This
limitation does not apply to the \s-1XS\s0 version.
.IP "part \s-1BLOCK LIST\s0" 4
.IX Item "part BLOCK LIST"
Partitions \s-1LIST\s0 based on the return value of \s-1BLOCK\s0 which denotes into which
partition the current value is put.
.Sp
Returns a list of the partitions thusly created. Each partition created is a
reference to an array.
.Sp
.Vb 2
\&    my $i = 0;
\&    my @part = part { $i++ % 2 } 1 .. 8;   # returns [1, 3, 5, 7], [2, 4, 6, 8]
.Ve
.Sp
You can have a sparse list of partitions as well where non-set partitions will
be undef:
.Sp
.Vb 1
\&    my @part = part { 2 } 1 .. 10;          # returns undef, undef, [ 1 .. 10 ]
.Ve
.Sp
Be careful with negative values, though:
.Sp
.Vb 3
\&    my @part = part { \-1 } 1 .. 10;
\&    _\|_END_\|_
\&    Modification of non\-creatable array value attempted, subscript \-1 ...
.Ve
.Sp
Negative values are only ok when they refer to a partition previously created:
.Sp
.Vb 3
\&    my @idx  = ( 0, 1, \-1 );
\&    my $i    = 0;
\&    my @part = part { $idx[$++ % 3] } 1 .. 8; # [1, 4, 7], [2, 3, 5, 6, 8]
.Ve
.SH "EXPORTS"
.IX Header "EXPORTS"
Nothing by default. To import all of this module's symbols, do the conventional
.PP
.Vb 1
\&    use List::MoreUtils \*(Aq:all\*(Aq;
.Ve
.PP
It may make more sense though to only import the stuff your program actually
needs:
.PP
.Vb 1
\&    use List::MoreUtils qw{ any firstidx };
.Ve
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
When \f(CW\*(C`LIST_MOREUTILS_PP\*(C'\fR is set, the module will always use the pure-Perl
implementation and not the \s-1XS\s0 one. This environment variable is really just
there for the test-suite to force testing the Perl implementation, and possibly
for reporting of bugs. I don't see any reason to use it in a production
environment.
.SH "BUGS"
.IX Header "BUGS"
There is a problem with a bug in 5.6.x perls. It is a syntax error to write
things like:
.PP
.Vb 1
\&    my @x = apply { s/foo/bar/ } qw{ foo bar baz };
.Ve
.PP
It has to be written as either
.PP
.Vb 1
\&    my @x = apply { s/foo/bar/ } \*(Aqfoo\*(Aq, \*(Aqbar\*(Aq, \*(Aqbaz\*(Aq;
.Ve
.PP
or
.PP
.Vb 1
\&    my @x = apply { s/foo/bar/ } my @dummy = qw/foo bar baz/;
.Ve
.PP
Perl 5.5.x and Perl 5.8.x don't suffer from this limitation.
.PP
If you have a functionality that you could imagine being in this module, please
drop me a line. This module's policy will be less strict than List::Util's
when it comes to additions as it isn't a core module.
.PP
When you report bugs, it would be nice if you could additionally give me the
output of your program with the environment variable \f(CW\*(C`LIST_MOREUTILS_PP\*(C'\fR set
to a true value. That way I know where to look for the problem (in \s-1XS,\s0
pure-Perl or possibly both).
.SH "SUPPORT"
.IX Header "SUPPORT"
Bugs should always be submitted via the \s-1CPAN\s0 bug tracker.
.PP
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=List\-MoreUtils>
.SH "THANKS"
.IX Header "THANKS"
Credits go to a number of people: Steve Purkis for giving me namespace advice
and James Keenan and Terrence Branno for their effort of keeping the \s-1CPAN\s0
tidier by making List::Utils obsolete.
.PP
Brian McCauley suggested the inclusion of \fIapply()\fR and provided the pure-Perl
implementation for it.
.PP
Eric J. Roode asked me to add all functions from his module \f(CW\*(C`List::MoreUtil\*(C'\fR
into this one. With minor modifications, the pure-Perl implementations of those
are by him.
.PP
The bunch of people who almost immediately pointed out the many problems with
the glitchy 0.07 release (Slaven Rezic, Ron Savage, \s-1CPAN\s0 testers).
.PP
A particularly nasty memory leak was spotted by Thomas A. Lowery.
.PP
Lars Thegler made me aware of problems with older Perl versions.
.PP
Anno Siegel de-orphaned \fIeach_arrayref()\fR.
.PP
David Filmer made me aware of a problem in each_arrayref that could ultimately
lead to a segfault.
.PP
Ricardo Signes suggested the inclusion of \fIpart()\fR and provided the
Perl-implementation.
.PP
Robin Huston kindly fixed a bug in perl's \s-1MULTICALL API\s0 to make the
XS-implementation of \fIpart()\fR work.
.SH "TODO"
.IX Header "TODO"
A pile of requests from other people is still pending further processing in
my mailbox. This includes:
.IP "\(bu" 4
List::Util export pass-through
.Sp
Allow \fBList::MoreUtils\fR to pass-through the regular List::Util
functions to end users only need to \f(CW\*(C`use\*(C'\fR the one module.
.IP "\(bu" 4
uniq_by(&@)
.Sp
Use code-reference to extract a key based on which the uniqueness is
determined. Suggested by Aaron Crane.
.IP "\(bu" 4
delete_index
.IP "\(bu" 4
random_item
.IP "\(bu" 4
random_item_delete_index
.IP "\(bu" 4
list_diff_hash
.IP "\(bu" 4
list_diff_inboth
.IP "\(bu" 4
list_diff_infirst
.IP "\(bu" 4
list_diff_insecond
.Sp
These were all suggested by Dan Muey.
.IP "\(bu" 4
listify
.Sp
Always return a flat list when either a simple scalar value was passed or an
array-reference. Suggested by Mark Summersault.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
List::Util
.SH "AUTHOR"
.IX Header "AUTHOR"
Adam Kennedy <adamk@cpan.org>
.PP
Tassilo von Parseval <tassilo.von.parseval@rwth\-aachen.de>
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
Some parts copyright 2011 Aaron Crane.
.PP
Copyright 2004 \- 2010 by Tassilo von Parseval
.PP
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
