You need binmode.
- tye
In reply to Re^3: Write Matlab binary MAT-files from Perl (binmode) by tye in thread Write Matlab binary MAT-files from Perl by Anonymous Monk