How about setting local $/ to a reference to integer before the call, and then read one scalar from the handle?
{ local $/ = \get_next_length(); $foo = <FH>; }
Are you decoding RIFF files, by chance? You may want to think about unpack's 'C4 V/A*' format ( I think that's correct for RIFF)
After Compline,
Zaxo
In reply to Re: Length-limiting handle
by Zaxo
in thread Length-limiting handle
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |