# List all packet types that this script knows about my %Idents = ( Rotation_Marker => 0x90, Format_7 => 0x87, ); # List packet lengths of each of the packet types (Ident char to checksum, inclusive) my %Packet_Length = ( $Idents{ Rotation_Marker } => 30, $Idents{ Format_7 } => 28, ); # unpack templates to use for each packet type (not including the packet Ident) my %packet_template = ( $Idents{ Rotation_Marker } => "C3 n n n n n n n n n n n n C3", $Idents{ Format_7 } => "C B16 n2 A4 A8 A2 A A A3 C2", );