Building a list from a list looks like a job for map. But unless order is really important, and it isn't just alphabetical order (using sort is easy enough), a list of pairs looks like something that could have its place in a hash. So, based on kennethk's answer (Edit: and similar AnomalousMonk's proposition):
It shouldn't be much trouble to turn that into a array of arrays if needed :).$current = 'a'; my %cds = map { $_ => $current++ } @cd_names;
In reply to Re: Generate list from a to arbitrary letter
by Eily
in thread [Solved] Generate list from a to arbitrary letter
by three18ti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |