my $glob_string = ( '{' . join( ',', 'A'..'D' ) . '}1' ) x $level; my @indices; while ( < $glob_string > ) { push @indices, $_ }