in reply to How to use Convert::ASN1 ?

I find the synopsis of Convert::ASN1 quite clear:

use Convert::ASN1; $asn = Convert::ASN1->new; $asn->prepare(q< [APPLICATION 7] SEQUENCE { int INTEGER, str OCTET STRING } >); $pdu = $asn->encode( int => 7, str => "string"); $out = $asn->decode($pdu); print $out->{int}," ",$out->{str},"\n";

Where exactly do you have problems?

Replies are listed 'Best First'.
Re^2: How to use Convert::ASN1 ?
by bh_perl (Monk) on Sep 16, 2008 at 08:18 UTC

    Actually, I have asn.1 file and the sample as below.

    My problem is how could i read ASN.1 data and display the value ? I did not know how to do that and I could not macthed your program with my data.

    9f a1 0b 00 9f a1 0b 00 9f be 00 02 00 15 9f be 01 81 0f 01 55 18 f3 0b 24 99 20 10 00 10 00 00 00 01 9f be 19 81 09 00 01 10 60 18 00 38 38 11 9f be 1b 08 02 01 10 ff ff ff ff ff a1 06 82 04 04 00 00 00

      I guess that ASN1 expects you to supply the data description. So you would have to have the description of your data somewhere in your documentation. You don't show your data description at all here, so I don't know what it is.

      After you've created the ASN decoder using the description, you pass it data to decode. That's it.

      You've posted a hexdump of your data for the second time. What do you expect us to do with that hexdump?

      Where exactly do you have problems? You haven't shown a single line of code, so that makes it kinda hard for me to give you more concrete help than pointing you to the module documentation.