WisDomSeeKer34 has asked for the wisdom of the Perl Monks concerning the following question:
I get this answer:#!usr/bin/perl use warnings; use strict; use Algorithm::Combinatorics qw(combinations); my @data = qw(1, 2, 3); # scalar context gives an iterator my $iter = permutations(\@data); while (my $p = $iter->next) { # ... } # list context slurps my @all_permutations = permutations(\@data);"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: script doesn't run
by bitingduck (Deacon) on Mar 19, 2015 at 04:24 UTC |