in reply to Length of unpacked string for "hex" data
$record[0] = pack ("A2IA7", "RT", 7, "testing"); $record[1] = pack ("A2IH16", "CD", 16, "01020304FFDDEC19"); # Prints ASCII fields fine, truncates hex for (my $i=0; $i<2; $i++) { my ($kw) = unpack("A2", $record[$i]); my ($rdata) = unpack("x2I/$kwfmt{$kw}", $record[$i]); print "$kw $rdata\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Length of unpacked string for "hex" data
by SirBones (Friar) on Apr 24, 2006 at 19:54 UTC |