in reply to Handling Hex data with Dynamic unpack

No doubt, I can decode the binary file this way.

I don't know many binary files represented as hex-text, so that won't work

Also, the format specification doesn't specify endianess so the format spec seems incomplete

I dont want to code with C kind of logic

:) But but but but, aren't you dealing with C-kind of data? Maybe Convert::Binary::C can help?

  • Comment on Re: Handling Hex data with Dynamic unpack

Replies are listed 'Best First'.
Re^2: Handling Hex data with Dynamic unpack
by PerlJedi (Novice) on Jul 05, 2012 at 10:11 UTC

    It is a BCD encoded binay file which is read in binary() mode.

    It follows a Big Endian notation.

    By C kind of logic, I meant the usual way of using loops etc.

      You might find the Template Grouping section of perlpacktut interesting, though I think writing some loops would be easier.

        Yes ... I did look through it and came up with some basic code ... but offcourse, I need to come up with complete code and then ask for other ways to handle the solution.

        Thanks ig :) for your reply.

      It is a BCD encoded binay file which is read in binary() mode.

      What does that mean?

      By C kind of logic, I meant the usual way of using loops etc.

      I think first you have to write some loops :)

        Sorry for the abbreviations.

        BER - http://en.wikipedia.org/wiki/Basic_Encoding_Rules

        DER - http://en.wikipedia.org/wiki/Distinguished_Encoding_Rules

        Its mainly the Telecom industry used standards

        Well, it is not following any of those BER or DER encoded binary file. Its just a plain binary file.