...suppose I want to find all possible combinations of any word.
$string = param('string');
If the string was, say, frost, what would I need to write to get all combinations of the letters in one shot.
frost
tsorf
rostf
ostfr
stfro
tfros
sorft
orfst
and so forth...
I know I need to put the 'string' into some array of some sort, but I'm stuck. The most I could come up with is to reverse it.
$stringrev = reverse$string;
@string = (); # ???
for $_(@string) {
## clueless
}
Thanx
$string = param('string');
If the string was, say, frost, what would I need to write to get all combinations of the letters in one shot.
frost
tsorf
rostf
ostfr
stfro
tfros
sorft
orfst
and so forth...
I know I need to put the 'string' into some array of some sort, but I'm stuck. The most I could come up with is to reverse it.
$stringrev = reverse$string;
@string = (); # ???
for $_(@string) {
## clueless
}
Thanx