Perl all Possibilitys

If you want all possibility’s in Perl for some chars try this:

@CONV = glob( "{0,1}" x 2 );
print "@CONV";

And we get this:

00 01 10 11

A little bit more complex is this:

@CONV = glob( "{A,B,C,D}" x 4 );
print "@CONV";

And as result we get this:

AAAA AAAB AAAC AAAD AABA AABB AABC AABD AACA AACB AACC AACD AADA AADB AADC AADD ABAA ABAB ABAC ABAD ABBA ABBB ABBC ABBD ABCA ABCB ABCC ABCD ABDA ABDB ABDC ABDD ACAA ACAB ACAC ACAD ACBA ACBB ACBC ACBD ACCA ACCB ACCC ACCD ACDA ACDB ACDC ACD
D ADAA ADAB ADAC ADAD ADBA ADBB ADBC ADBD ADCA ADCB ADCC ADCD ADDA ADDB ADDC ADDD BAAA BAAB BAAC BAAD BABA BABB BABC BABD BACA BACB BACC BACD BADA BADB BADC BADD BBAA BBAB BBAC BBAD BBBA BBBB BBBC BBBD BBCA BBCB BBCC BBCD BBDA BBDB BBDC B
BDD BCAA BCAB BCAC BCAD BCBA BCBB BCBC BCBD BCCA BCCB BCCC BCCD BCDA BCDB BCDC BCDD BDAA BDAB BDAC BDAD BDBA BDBB BDBC BDBD BDCA BDCB BDCC BDCD BDDA BDDB BDDC BDDD CAAA CAAB CAAC CAAD CABA CABB CABC CABD CACA CACB CACC CACD CADA CADB CADC
 CADD CBAA CBAB CBAC CBAD CBBA CBBB CBBC CBBD CBCA CBCB CBCC CBCD CBDA CBDB CBDC CBDD CCAA CCAB CCAC CCAD CCBA CCBB CCBC CCBD CCCA CCCB CCCC CCCD CCDA CCDB CCDC CCDD CDAA CDAB CDAC CDAD CDBA CDBB CDBC CDBD CDCA CDCB CDCC CDCD CDDA CDDB CD
DC CDDD DAAA DAAB DAAC DAAD DABA DABB DABC DABD DACA DACB DACC DACD DADA DADB DADC DADD DBAA DBAB DBAC DBAD DBBA DBBB DBBC DBBD DBCA DBCB DBCC DBCD DBDA DBDB DBDC DBDD DCAA DCAB DCAC DCAD DCBA DCBB DCBC DCBD DCCA DCCB DCCC DCCD DCDA DCDB 
DCDC DCDD DDAA DDAB DDAC DDAD DDBA DDBB DDBC DDBD DDCA DDCB DDCC DDCD DDDA DDDB DDDC DDDD

Leave a Reply

Your email address will not be published.

9 + 7 =