RosettaCodeData/Task/Power-set/Perl/power-set-3.pl

8 lines
157 B
Perl
Raw Permalink Normal View History

2015-11-18 06:14:39 +00:00
use ntheory "forcomb";
2018-06-22 20:57:24 +00:00
my @S = qw/a b c/;
2015-11-18 06:14:39 +00:00
for $k (0..@S) {
# Iterate over each $#S+1,$k combination.
forcomb { print "[@S[@_]] " } @S,$k;
2014-04-02 16:56:35 +00:00
}
2015-11-18 06:14:39 +00:00
print "\n";