NAME

Util::Medley::List - utility methods for working with lists

VERSION

version 0.018

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

listToMap

usage:
  %map = $util->listToMap(@list);

  %map = $util->listToMap(list => \@list);
   
args:
list [Array|ArrayRef]

The array you wish to convert to a hashmap.

min

Just a passthrough to List::Util::min()

usage:
 $min = $util->min(@list);
 
 $min = $util->min(list => \@list);

max

Just a passthrough to List::Util::max()

usage:
 $max = $util->max(@list);
 
 $max = $util->max(list => \@list);

nsort

Sort an array naturally (case in-sensitive). Just a passthrough to Sort::Naturally::nsort.

usage:
 @sorted = $util->nsort(@list);
 
 @sorted = $util->nsort(list => \@list);
args:
list [Array|ArrayRef]

The list to act on.

undefsToStrings

usage:
 %map = $util->undefsToStrings($list, [$string]);

 %map = $util->undefsToStrings(list => \@list, [string => $str]);
   
args:
list [ArrayRef]

The list to act on.

string [Str]

What to convert undef items to. Default is empty string ''.

uniq

Just a proxy to List::Util::uniq().

usage:
 @uniq = $util->uniq(@list);

 @uniq = $util->uniq(list => \@list);