You can use the pack function to create a binary value in a scalar variable, and then write it to the output file. Be sure to use binmode on the file handle so that it won't modify the binary values you send. Something like:
use strict; use warnings; my $foo = 12345; $foo = pack "l", $foo; open my $FH, '>', "foo.bin"; binmode($FH); print $FH $foo; close $FH;
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: output binary data
by roboticus
in thread output binary data
by Allasso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |