http://www.perlmonks.org?node_id=146419

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi PerlMonks,
here's my problem:

I have an array of less than 6 strings, and I want to print all combinations of these strings.
Ex:
@words = (nvidia,GeForce,2,MX);
this should print out:
nvidia GeForce 2 MX
nvidia 2 MX
nvidia GeForce MX
nvidia MX
nvidia 2 GeForce
nvidia MX 2
nvidia MX GeForce
GeForce nvidia
GeForce nvidia 2
GeForce nvidia MX
GeForce 2 nvidia
.
.
etc.

please help me find a solution to this, I'd be so grateful :)
-Dar