1 2 3 4 5 6 7
sub writeInt { my $array=shift; my $pos=shift; my $value=shift; @array[$pos..$pos+3]=unpack('C*',pack('N',$val1)); }
1 2 3 4
my @array; my $pos=16; my $val=10; writeInt(\@array,$pos,$val);