Permalink
Browse files

[other/combinations.pl] POD added.

  • Loading branch information...
1 parent 220cec7 commit 5da3bb3815f04d6e8d9665dc62a28578336837ee @sergot sergot committed May 21, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 other/combinations.pl
View
@@ -1,6 +1,28 @@
+=begin pod
+
+=head1 Combinations
+
+Prints all the combinations of items from given array.
+
+=head1 What's interesting here?
+
+=item multi subroutines
+=item shortened use of $_ variable
+=item placeholder variables
+
+=end pod
+
use v6;
multi combs(@, 0) { "" };
multi combs { combs(@^dict, $^n - 1) X~ @dict };
(.say for combs(<a b c>, $_)) for 1..4;
+
+=begin pod
+
+=head1 Features used
+
+=item C<Placeholder variables> - L<http://perlcabal.org/syn/S06.html#Placeholder_variables>
+
+=end pod

0 comments on commit 5da3bb3

Please sign in to comment.