in reply to Creating a binary file problem
It looks like $gBuf{$bName} had been populated with the string representations of these numbers. Can't say for sure, since we don't see that get populated in your code. But I was able to replicate your problem by populating that array like this:
$gBuf{$bName}[0] = '0x00000019'; $gBuf{$bName}[1] = '0x0000001b'; (etc)
However, if I populate it this way, I don't see the error:
so you may want to either go back and fix how those values get in there, or use oct() to convert it to a number. I am guessing you want oct, since you are using pack with 'C', but those numbers look like hex to me.$gBuf{$bName}[0] = 0x00000019; $gBuf{$bName}[1] = 0x0000001b;
|
|---|