Greeting monks!
I am just wondering if there is any module on CPAN that is counterpart to built-in pack/unpack.
That will offer compiled template (for fixed template), so that for performance critical bits, compiled pack/unpack could be used. I believe clojure/python has something similar.
#hypothetical module
use Binary::Parser;
$compiled_template = Binary::Parser->new( template => 'nCC C/a');
my @result = $compiled_template->unpack($binary_data);
# would be nice to have, like regex ? (0 or one) at the end
# it will match C C/a
# C C/a B8
# C C/a B8 f ...
$optional_template = Binary::Parser->new( template => 'C C/a (B8 ff c
+c)?');