Hello Anonymous Monk,

First of all I want to say a big thank you for the analytic answer to my question.

You helped me to understand a lot, not only about the binary process on Perl but also how my future questions should be written so people can follow easier and sujest possible alternative solutions.

Well I am working on Simple Network Time Protocol (SNTP). I have created a simple version UDP SNTP Client/Server RFC. Where I was introduced to the idea to submit my code to CPAN library.

So I decided to add all the features and details that the RFC 2030 describes.

I have created the improved version and it seems fine from my point of view. I will post it possibly today or tomorrow to ask for possible minor improvements from all the expert Monks here.

So in order to make my script as generic as possible I wanted to follow the instructions "by letter". But to be 100% honest it would not make a difference if I have a 3 bit int "i" or 3 bit character "c". The representation is only an integer number 7. So I want to believe that it will not be a problem, with the 8 bit character that I am cutting to 3 bit. The program on both sides client and server can encode and decode the number. So I assume there is no problem about it.

Since I am not really experienced with binaries I tried to do my best, and I hope that the scripts will have minimum possible bugs.

So more or less I described my task that actually I am doing for fun while I am trying to improve my skills and keep my mind busy.

Again thank you for your time and effort answering my question and providing such an analytic answer.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^4: pack and unpack with 8 bit integers by thanos1983
in thread pack and unpack with 8 bit integers by thanos1983

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.