in reply to Length-limiting handle
If the outer function knows enough to decide that the entire block is 20 bytes, why not have it read the 20 bytes and then pass a string into the subparsers rather than having them read from the handle?
On your other question about remembering the raw input consumed by each level of your structure. You don't mention what the structure loooks like, but could you use parrellel elements? If its a hash, have a key 'foo' for the parsed data and 'foo_raw' for the input from which it was derived. If the element 'foo' is an array, the 'foo_raw' could just be a scalar containing everything that was consumed to derive the array?
Speculation.
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.
|
|---|