#!/usr/bin/perl -l use warnings; use strict; use Algorithm::Permute; ########################################################### # Opening file to write the program's output. ################################################### open(FH, ">myPer .txt") or die "Cannot open myPer .txt"; ########################################################### my @arr = qw/A B C/; my $N=scalar(@arr); my $permu=2; my $p = new Algorithm::Permute([@arr], $permu); print"\n WELCOME to Permutation Analysis:\n All Possible Permutations of $permu Elements out of $N .i.e. $N P $permu:\n"; print FH "\n WELCOME to Permutation Analysis:\n All Possible Permutations of $permu Elements out of $N .i.e. $N P $permu:\n"; while (my(@res) = $p->next) { do {print join("", @res);};} while (my(@res) = $p->next) { do {print join("", @res);};} close FH; exit 0; #### WELCOME to Permutation Analysis: All Possible Permutations of 2 Elements out of 3 .i.e. 3 P2: