in reply to parsing Binary Structures using unpack

My first question would be, "where/how did you get the data that you put into $packet?" Try looking at data you get using.
   split /\r\n/,$packet
The data you show doesn't seem to match the documention in the URL you posted