Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: incrementing mixed letters and numbers

by hdb (Monsignor)
on Aug 22, 2017 at 13:31 UTC ( #1197800=note: print w/replies, xml ) Need Help??


in reply to incrementing mixed letters and numbers

variations_with_repetition in module Algorithm::Combinatorics also does what you want:

use strict; use warnings; use Algorithm::Combinatorics 'variations_with_repetition'; my @data = (0..9,'a'..'z'); my $iter = variations_with_repetition( \@data, 4 ); while( my $c = $iter->next ) { print "@$c\n"; }

It does end though when it reaches 'zzzz'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1197800]
help
Chatterbox?
and God said, "Let Newton be!"...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-07-18 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (393 votes). Check out past polls.

    Notices?