in reply to RegEx Confusion!

A regex here is overkill (since it would end up requiring backtracking at the "mystery" part):
($flag1, $bytecount, $mystery, $flag2) = $frame =~ m{ ^ ( [01]{8} ) ( [01]{16} ) ( [01]*? ) # that could be [01]* for all I care... ( [01]{8} ) $ }x;
I'd much rather use substr() and unpack():
($flag1, $bytecount, $mystery) = unpack "A8 A16 A*", $frame; $flag2 = substr($mystery, -8, 8, '');
No backtracking. Just simplicity.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;