dasgar points out what seems likely to be your most immediate problem.
In addition, you don't define the structure of your data records, but if the 'record length' field is anything other than four decimal digits (in particular, if it's a raw, four-byte integer of some kind), you may have a problem down the road with record lengths that work out to be something unexpected, especially zero. (However, you do have warnings turned on, which could alert you if some of these problems arise.)
Here are some examples of the handling of various four-digit strings. The '0123' string is intended to represent something that some humans and computers might be tempted to interpret as an octal number. The qq{\x00\x00\x00\x08} represents a 32-bit, raw binary, big-endian 8.
>perl -wMstrict -le "print qq{'$_' -> }, 0 + $_ for '1234', '12AB', 'AB12', '0123', qq{\x00\x00\x00\x08}; " '1234' -> 1234 Argument "12AB" isn't numeric in addition (+) at -e line 1. '12AB' -> 12 Argument "AB12" isn't numeric in addition (+) at -e line 1. 'AB12' -> 0 '0123' -> 123 Argument "\0\0\0^H" isn't numeric in addition (+) at -e line 1. ' ' -> 0
In reply to Re: Can someone tell me why this hangs??
by AnomalousMonk
in thread Can someone tell me why this hangs??
by monty77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |