logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

List::MoreUtils::XS - Provide compiled List::MoreUtils functions

Author

       Jens Rehsack <rehsack AT cpan.org>

       Adam Kennedy <adamk@cpan.org>

       Tassilo von Parseval <tassilo.von.parseval@rwth-aachen.de>

Description

       List::MoreUtils::XS is a backend for List::MoreUtils. Even if it's possible (because of user wishes) to
       have it practically independent from List::MoreUtils, it technically depend on "List::MoreUtils". Since
       it's only a backend, the API is not public and can change without any warning.

Name

       List::MoreUtils::XS - Provide compiled List::MoreUtils functions

See Also

       List::Util, List::AllUtils

Synopsis

         use List::MoreUtils::XS (); # doesn't export anything
         use List::MoreUtils ':all'; # required to import functions

         my @procs = get_process_stats->fetchall_array;
         # sort by ppid, then pid
         qsort { $a->[3] <=> $b->[3] or $a->[2] <=> $b->[2] } @procs;
         while( @procs ) {
             my $proc = shift @procs;
             my @children = equal_range { $_->[3] <=> $proc->[2] } @procs;
         }

         my @left = qw(this is a test);
         my @right = qw(this is also a test);
         my %rlinfo = listcmp @left, @right;

         # on unsorted
         my $i = firstidx { $_ eq 'yeah' } @foo;
         # on sorted - always first, but might not be 'yeah'
         my $j = lower_bound { $_ cmp 'yeah' } @bar;
         # on sorted - any of occurrences, is surely 'yeah'
         my $k = bsearchidx { $_ cmp 'yeah' } @bar;

See Also