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).
|
---|
In Section
Seekers of Perl Wisdom