Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: incrementing mixed letters and numbers

by Perlbotics (Chancellor)
on Aug 22, 2017 at 17:34 UTC ( #1197821=note: print w/replies, xml ) Need Help??


in reply to incrementing mixed letters and numbers

Since glob has not been mentioned yet, here's another solution (TIMTOWTDI).

use strict; use warnings; my $start = 'zzy0'; #-- start including this 'number' my $end = 'zzz5'; #-- end including this 'number' my $set = '{' . join(',', 0..9, 'a'..'z') . '}'; #-- max. range is '0000' .. 'zzzz' for ( glob "$set$set$set$set" ) { print $_,"\n" if /$start/ .. /$end/; }

Caveat: This approach is not efficient. It can consume lots of memory and time (filtering).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1197821]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2018-05-23 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?