There's more than one way to do things | |
PerlMonks |
Re: Make a hash by a range of keys and valuesby johngg (Canon) |
on Nov 01, 2018 at 00:27 UTC ( [id://1225027]=note: print w/replies, xml ) | Need Help?? |
This is similar to already proposed solutions except that it uses maps rather than loops. I'm only posting it because others might be interested in the way you can pass a subroutine reference to Data::Dumper->Sortkeys() to control the key sort order; I'd not seen this before but went looking in the docs for a solution when I realised that magic-incrementing the key beyond "z" would make a mess of the default ->Sortkeys() output.
The output.
I hope this is of interest. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|