Consider this snippet:
use strict;
use warnings;
my $data = "1";
my $packed = pack("I",$data);
open(my $file,">","test.bin") || die "error $!\n";
binmode $file;
print $file $packed;
The fact is that, trying to read it from another language, this seems insignificant. Is there a template argument that allows me to write it as a big endian? I would like to avoid the extra work of reading.
source
share