#!/usr/bin/perl -w use strict; open( FH, ">junk.dat" ) or die "dang it!\n"; binmode FH; my $num = pack 'V',1234; print FH $num; close FH;
If the program is going to be run on Windows as well you should also binmode the filehandle as shown above.
--
John.
In reply to Re: writing binary data in perl
by jmcnamara
in thread writing binary data in perl
by rbc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |