$var = pack "C2", 0x20, 0x30;
seems to work quite well, but now, how can I access the elements of the array? Make changes to items? In place, if possible. The semantics of pack / unpack are not very friendly.
I am currently using substr($var, $index, 1, substr($var, $index, 1) + 10) to add 10 to the elements in place.
And for integrators, if I need a 100-byte 0x20 array, what's the best way? $var = "\x20" x 100 works, is this the "right" way?
source share