How do you know that substr is pretty inefficient?
Anyway, I'd use unpack for this, as it deals pretty well with extracting fixed-length stuff from strings:
my ($header, @items) = unpack "a300(a18)250", $buff;
In reply to Re: Reading nested records in binary data
by Corion
in thread Reading nested records in binary data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |