-
-
17 Dec 2021 01:56:23 UTC
- Distribution: Util-Medley
- Module version: 0.061
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (62 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.16.0
- Activity
24 month- Tools
- Download (50.72KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
++ed by:2 non-PAUSE users- Dependencies
- Alt::Devel::CallParser::ButWorking
- Archive::Zip
- CHI
- CLI::Driver
- Carp
- Crypt::Blowfish
- Crypt::CBC
- Data::Printer
- DateTime::Format::ISO8601
- DateTime::Format::ISO8601::Format
- Exporter::Easy
- Fcntl
- File::Basename
- File::LibMagic
- File::Path
- File::ShareDir
- File::Slurp
- File::Touch
- File::Which
- FileHandle
- Getopt::Long
- Hash::Merge
- IPC::Run3
- Kavorka
- List::Compare
- List::Util
- Modern::Perl
- Module::Load
- Module::Overview
- Moose
- Moose::Role
- Number::Format
- Path::Iterator::Rule
- Scalar::Util
- Scalar::Util::Numeric
- Sort::Naturally
- String::Util
- Text::ASCIITable
- Text::Table
- Time::HiRes
- Time::Local
- Time::ParseDate
- Time::localtime
- Try::Tiny
- YAML
- constant
- diagnostics
- namespace::autoclean
- strict
- vars
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Util::Medley::List - utility methods for working with lists
VERSION
version 0.061
SYNOPSIS
%map = $util->listToMap(@list); %map = $util->listToMap(list => \@list); $min = $util->min(@list); $min = $util->min(list => \@list); $max = $util->max(@list); $max = $util->max(list => \@list); @list = $util->undefsToStrings(@list); @list = $util->undefsToStrings(list => \@list); @uniq = $util->uniq@list); @uniq = $util->uniq(list => \@list);
DESCRIPTION
...
METHODS
contains
Search for pattern in a list.
Returns bool
- usage:
-
$bool = $util->contains(\@list, 'mystring'); $bool = $util->contains(\@list, undef); $bool = $util->contains(\@list, qr/myregex/); $bool = $util->contains(list => \@list, match => 'mystring'); $bool = $util->contains(list => \@list, match => undef); $bool = $util->contains(list => \@list, match => qr/myregex/);;
- args:
diff
Returns an array of elements that are found in list1 or list2, but not both.
Wrapper around List::Compare::get_symmetric_difference().
- usage:
-
@diff = $util->diff(\@list1, \@list2, $sort); @diff = $util->diff(list1 => \@list1, list2 => \@list2, sort => $sort);
- args:
differ
Compares two arrays and returns true if they differ or false if not.
- usage:
-
$bool = $util->differ(\@list1, \@list2, $sort); $bool = $util->diff(list1 => \@list1, list2 => \@list2, sort => $sort);
- args:
isArray
Checks if the scalar value passed in is an array.
listToMap
min
Just a passthrough to List::Util::min()
max
Just a passthrough to List::Util::max()
nsort
Sort an array naturally (case in-sensitive). This behaves the same way Sort::Naturally::nsort does with the exception of using fc (casefolding) instead of lc (lowercase). This guarantees the same results without regard to locale (which Sort::Naturally::nsort does use).
shuffle
Just a passthrough to List::Util::shuffle()
undefsToStrings
- usage:
-
%map = $util->undefsToStrings($list, [$string]); %map = $util->undefsToStrings(list => \@list, [string => $str]);
- args:
uniq
Just a proxy to List::Util::uniq().
Module Install Instructions
To install Util::Medley, copy and paste the appropriate command in to your terminal.
cpanm Util::Medley
perl -MCPAN -e shell install Util::Medley
For more information on module installation, please visit the detailed CPAN module installation guide.