#!/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;