Dermot wrote:
2009/2/4 Rob Canning <robcann...@eircom.net>:
hello,
i am new to this list and very new to pearl.
i have run into a problem i cant find a solution  - i have searched the net
for an answer but as i am so new to perl (and programming in general)
perhaps i dont even know the right keywords...

ok here it goes..

use Math::Combinatorics;

 my @n = qw(tomfl toml tomml tommh tomh);
 my @permutations = (join(" ",map { join " ", @$_ } permute(@n)),"\n");


I think if you drop the out join you will be fine:

my @permutations = map { join " ", @$_ } permute(@n);

Good luck,
Dp.

Thanks Dermot!

That was it - in fact i needed each element rather than each permutation set but getting rid of the join was the key
i got rid of both of them now my script is working as i would like:

my @permutations = map {...@$_} permute(@n);

many thanks

rob c


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to