in reply to Data structure for this...

You could use a hash like this:
my @keys = qw(flags x y mode3 callsign route spare1 spare2 flight_leve +l terminator chksum_packet); my %record; @record{@keys} = unpack("B16 n2 A4 A8 A2 A A A3 C2", $buffer);
Just use $record{flags} instead of $flags etc.