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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.