Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: incrementing mixed letters and numbers

by Perlbotics (Archbishop)
on Aug 22, 2017 at 17:34 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1197821]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found