in reply to Creating a binary file problem
Picking up on the "Any help appreciated" comment:
so your code could look like:
use strict; use warnings; my $fn = "delme.bin"; my $bName = 'eps_cm_0_pblk1'; my %gBuf = (eps_cm_0_pblk1 => ['0x00000019', '0x0000001b']); open my $binOut, '>', $fn or die "Couldn't open '$fn' for writing: $!n +"; binmode $binOut; foreach my $element (@{$gBuf{$bName}}) { print $binOut pack ('C', hex $element); } close $binOut;
|
|---|