Enhance Perl output with binary offsets

This patch adds a binary offset to the generated Perl output, similar to
the Python generated code.