I have a string like this , how are you
, I want to get all possible shuffle of word like
how are you
are how you
you how are
you are how
are you how
how you are
How can I make it in perl
script , i've tried the shuffle
function but it returns only one string of shuffle .
If you are not familiar with Perl
script, you can tell me the logic only.
Note: The words count in string are not constant.
What you're talking about are permutations. This can be done in Perl with the
Algorithm::Permute
module:If you've installed the module, here's a shell one-liner that will do it for you: