in reply to loop in loop method evasion

Or you can use Algorithm::Combinatorics module, specifically variations_with_repetition function. It uses iterator approach, so it consumes quite little memory. As was noted above, the number of results is very large, so following prints just first 50:
use Algorithm::Combinatorics qw(variations_with_repetition); my $iter = variations_with_repetition([ '0'..'9', 'a'..'z' ], 15); while($seq = $iter->next) { print @$seq,"\n"; last if ++$count > 50; }
-- Roman