Math::Subsets::List - Generate all the subsets of a list.
use Math::Subsets::List; subsets {say "@_"} qw(a b c); # # a # b # c # a b # a c # b c # a b c
Generate all the subsets of a list and process them using the standard Perl metaphor.
subsets() returns the number of subsets. Please note that this includes the empty set as it is a subset of all sets.
subsets()
Please note that the order in which the subsets are generated is not guaranteed, so please do not rely on it.
subsets() is easy to use and fast. It is written in 100% Pure Perl.
The subsets() function is exported.
Standard Module::Build process for building and installing modules:
perl Build.PL ./Build ./Build test ./Build install
Or, if you're on a platform (like DOS or Windows) that doesn't require the "./" notation, you can do this:
perl Build.PL Build Build test Build install
PhilipRBrenan@appaapps.com
http://www.appaapps.com
With lots of help and advice from Philip Rumpff to who I am most grateful.
Copyright (c) 2009 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Math::Subsets::List, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Subsets::List
CPAN shell
perl -MCPAN -e shell install Math::Subsets::List
For more information on module installation, please visit the detailed CPAN module installation guide.