in reply to Re^2: Problem on substr record on binary file
in thread Problem on substr record on binary file
Then why are you asking Perl to read until the next newline?
Besides, your data has two newlines.
84 47 00 0c 00 00 11 0a 03 50 35 04 00 64 0a 04 ^^ ^^ 16 12 00 1e 00 1d 00 00 65 09 08 54 52 03 2f 82 05 10 00 02 6e 06 0b a8 53 11 67 00 00 00 7a 7f 00 69 4a 42 47 48 4a 41 0c 00 6a 53 54 4d 44 54 4f 1c 00 66 04 00 00
If you want to read the whole file at once, why do you have a loop? Undefine $/ and get rid of the loop.
local $/; my $data = <DATA>;
If you're not trying to read the entire file at once, what are you trying to do?
|
|---|