Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: SNTP pack and unpack

by choroba (Cardinal)
on Mar 07, 2015 at 02:03 UTC ( [id://1119151]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1119151]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found