in reply to Please explain the pack function

Maybe this will help?

$integer = pack( 'i', 171 );; #The [pack] template 'i' converts a inte +ger print length( $integer );; # to a 4-byte string 4 # The first byte is ascii value 171 print ord( substr( $integer, $_, 1 ) ) for 0 .. 3;; 171 0 0 0 print chr( 171 );; ## Which displays as '½'. (On windows console,code +pages 437 & 850). ½ print chr( 172 );; ## Which displays as '¼'. (On windows console, code + pages 437 & 850). ¼

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Please explain the pack function
by Anonymous Monk on Apr 19, 2007 at 18:44 UTC
    BrowserUk,Thanks a lot for your help.