NAME

uHTML::ListFuncs - More list functions for perl

VERSION

Version 0.81

DESCRIPTION

This library provides the functions sample, shuffle, 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.

perl functions provided by the hHTML::ListFuncs library

uniq(@list)

Overview

The function uniq removes identical consecutive values from @list and returns the result, similar to uniq from GNU core utils.

Parameters

@list

List to process.

Example

foreach( uniq sort @list ) {...}

section($list1,$list2,$list3,...)

Overview

The function section computes the section of several lists.

Parameters

$list1,$list2,...

References of lists from which the section has to be computed.

Example

foreach( section( \@list1,\@list2 ) ) {...}

difference($list1,$list2)

Overview

The function difference removes from @{$list1} all elements contained in @{$list2}.

Parameters

$list1

Reference of the original list from which elements will be removed.

$list2

References of list with elements that will be removed from @{$list1}.

Example

foreach( difference( \@list1,\@list2 ) ) {...}

shuffle($list)

Overview

The function shuffle shuffles randomly @{$list}.

Parameters

$list

Reference of the list to be shuffled

Example

shuffle( \@list ) ;

sample($list,$count)

Overview

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.

Parameters

$list

Reference of the list from which elements will be picked.

$count

Count of elements to be picked from @{$list}.

Example

foreach( @{sample( \@list,$count )} ) {...}

SEE ALSO

perl(1), http://www.uhtml.de/en/doc/ListFuncs.uhtml

AUTHOR

Roland Mosler (Roland.Mosler@Place.Ug)

COPYRIGHT

Copyright 2009 Roland Mosler. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.