@RecordNames[94] = qw/$Destination $DestinationType/; @RecordLengths[94] = qw/$A8 A4/; #### $RecordNames[94] = "$Destination"; $RecordLengths[94] = "$A8"; #### $fields[94] = [ qw/Destination DestinationType/ ]; $lengths[94] = qq/A8 A4 / ; my @data{ @{$fields[94]} } = unpack($lengths[94], $Record); # then you have: # # $data{Destination} # $data{DestinationType}