develooper Front page | perl.perl5.porters | Postings from April 2013

Re: [perl #117661] perlfunc/perlpacktut pack w documentation

Thread Previous | Thread Next
From:
Marc Lehmann
Date:
April 19, 2013 09:17
Subject:
Re: [perl #117661] perlfunc/perlpacktut pack w documentation
Message ID:
20130419091644.GB3042@schmorp.de
On Thu, Apr 18, 2013 at 04:00:00PM -0700, Tony Cook via RT <perlbug-followup@perl.org> wrote:
> > 1. drop the "not an ASN.1 BER" comment, or at least qualify it, like
> >    "like an ASN.1 BER subidentifier, not a BER integer".
> > 
> >    At the very least the description of BER subidentifier encoding in
> >    X.209:198811 6.22 is much more concise than any I found in the perl
> >    documentation, so saying it isn't an ASN.1 BER is more confusing than
> >    helpful, because by all means it is.
> 
> "the integer encoding used for ASN.1 subidentifiers"

The BER encoding, not the integer encoding. I don't think there strictly
is something like an integer encoding for ASN.1 subidentifiers -
subidentifiers *are* integers, and BER is the encoding used by perl (there
are many encodings for ASN.1) to encode such subidentifiers (or any other
non-negative integer within range).

There also is a BER integer encoding, but it is indeed different (and can
represent negative integers as well).

It's also quite clear by the references you dug out that these integers
are in fact supposed to be BER encoded, and the "BER" term used by scarab
is the asn.1 ber, just that the author of the document was confused.

So, saying it is the ASN.1 BER subidentifier encoding might be very helpful for
some people, and saying it isn't the BER intger encoding

> > 2. remove the url in perlpacktut.
> 
> I wasn't able to find a good linkable reference either.

I don't think there needs to be one, or even should one. I think it would be
very bad for perl to refer to external documents to describe it's
functionality. If it's built in, perl should document it.

And I think it is documented reasonably well. What's not documented is why
it isn't ASN.1 BER (when it is), and the fix for that would likely be to
just drop the errornous statement.

> http://luca.ntop.org/Teaching/Appunti/asn1.html
> 
> provides a good description, but I didn't see any fragment ids.

Well, X.209 is freely downloadable from
http://www.itu.int/rec/T-REC-X.209-198811-W/en

However, BER subidentifier coding is so trivial that having any external
reference would be like hitting the perl user into the face with "yeah,
we could have described it in two sentences, but it's so much more fun to
force you to go online and wade through big documents".

Really, the integers is just grouped into 7-bit groups from most
significant to least signficant and all but the last have the 8th bit set.

It's so trivial it's not even neccessary to explain that this is asn.1 ber
subidentifier coding, it would just be a nice touch for those people who
need to decode them, but frankly, that's probably just me and two other
people or so, and even I use "w" a lot more for other uses (such as length
prefixes or a compact integer encoding).

But saying it isn't asn.1 ber encoding *is* confusing, because I kept
wondering about it, because I couldn't see why not.

:)

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp@schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About