in reply to Idiom for looping thru key/value pairs

<shameless_plug> Use iter. </shameless_plug>

You can also idiomize your loop a bit:

my ($code, $text) = splice @subdata, 0, 2;
Also, check out this discussion.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print