You're missing the binary file format description... You're also missing error checking (see autodie) ... you're probably also missing strict and warnings from your real code
Comment on Re: How to read a binary file with file header, data and file trailer ?