in reply to Re^2: SNTP pack and unpack
in thread SNTP pack and unpack

As can be easily demonstrated by
print prototype 'CORE::pack';

pack evaluates the first argument in scalar context. If you supply an array, it turns into the number of its members. You got 1, which is double weird, as it means the array only had one member - you have to supply two things to pack, the template and the list (and, as we have just seen, you can't bundle them in one array).

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^4: SNTP pack and unpack
by thanos1983 (Parson) on Mar 07, 2015 at 17:23 UTC

    Hello choroba,

    Thank you for your time and effort, there are so many things that I do not know. Your answer helped to view the way that pack should be defined.

    I minor note, it would be easier for me and in general for people who do not know much of Perl to write it like this.

    perl -le 'print prototype "CORE::pack"'

    Output:

    $@

    Thanks again for the time and effort, you helped me a lot understanding. Every area that someone has not worked before is always confusing at the beginning.

    Reference to using CORE::pack, CORE::unpack.

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