in reply to pack, unpack and internal represenation of numbers

pack and unpack convert things to and from an internal string representation. In your example, unpack interprets the scalar 0x01020304 in a string context, which is "16909060".

On the other hand, pack("L", 0x01020304) returns a string which is along the lines of "\x01\x02\x03\x04".

blokhead

Replies are listed 'Best First'.
Re^2: pack, unpack and internal represenation of numbers
by 5mi11er (Deacon) on Jul 01, 2004 at 20:57 UTC
    Yes!

    Explaining it fully for those that don't understand yet:

    From the string "16909060", '1'=ASCII(49) '6'=ASCII(54) '9'=ASCII(57) '0'=ASCII(48) etc.
    Thank you, that's the understanding I was looking for!