for( map '0'x$_ .. '9'x$_, 4..6 ) { #### for my $len ( 4 .. 6 ) { my $pat = '0' x $len; while( $len == length $pat ) { # ... $pat++; } }