This library provides the functions uniq
, section
and
difference
for perl. This library is used by many of the uHTML libraries.
It can be of use without uHTML as well.
To install the module project local, copy it into the uHTML
subdirectory of the
script-directory of the website. To install it globally, copy it into the uHTML
subdirectory of a perl-library directory.
It is allowed to use this library under the actual GNU General Public License. The name of this library and it's author is to be named in all derivations.
This uHTML::ListFuncs library do not need any other library.
uHTML::ListFuncs
libraryuniq, section, difference, shuffle, sample
uHTML::ListFuncs
library
The function uniq removes identical consecutive values
from @list
and returns the result, similar to uniq
from GNU core utils.
@list
( uniq sort @list ) {…
The function section computes the section of several lists.
$list1,$list2,…
( section( \@list1,\@list2 ) ) {…
The function difference removes from @{$list1}
all elements
contained in @{$list2}
.
$list1
$list2
@{$list1}
.
( difference( \@list1,\@list2 ) ) {…
The function shuffle shuffles randomly @{$list}
.
$list
shuffle( \@list ) ;
The function sample selects more or less evenly picked
$count
random elements from @{$list1}
.
The function returns a reference to a list with the samples.
$list
$count
@{$list}
.
( @{sample( \@list,$count )} ) {…