Aug 31, 2013, 2:11 AM
Re: [rpaskudniak] Byte-level pointers similar to C pointers
Using the Informix module would probably be the best.
As a more general solution to read specific bytes, what about opening your variable with a filehandler and using seek/read to read individual byte chunks? I am doing that from time to time on VMS/RMS binary files for which there is no usable module: fetching individual records and looking for specific fields in the records. I do not have an actual example here at home, but this is a quick example under the Perl debugger:
DB<1> $c = "The quick brown fox jumps over the lazy dog."
DB<2> open $fh, "<", \$c or die "could not open $c $!"; # opens a reference to the $c variable as a filehandler
DB<3> seek $fh, 10, "00"; # positions the filehandler on the 10th byte
DB<4> read $fh, $out, 10; # reads 10 bytes from position 10
DB<5> print $out;
(This post was edited by Laurent_R on Aug 31, 2013, 2:13 AM)