Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Re: pack peculiarity

by sgifford (Prior)
on Dec 27, 2003 at 06:58 UTC ( [id://317163]=note: print w/replies, xml ) Need Help??

in reply to Re: pack peculiarity
in thread pack peculiarity

To clarify a little bit (I hope), Perl's strings are a string of bytes, which may or may not be a string of printable characters. When Perl is asked to print a string, it just outputs all of the bytes in the string, one after the other. In this case, the bytes are 0x41 0x42 0x43 0x44, which happen to be the ASCII character codes for ABCD.

Update: As pg mentions below, this terminology might be wrong in the face of Unicode. If, for the sake of this example, you temporarily pretend Unicode doesn't exist, hopefully this comment will still shed some additional light. :-)

Replies are listed 'Best First'.
Re: Re: Re: pack peculiarity
by pg (Canon) on Dec 27, 2003 at 07:13 UTC

    I like the infomation you added. But you may want to reconsider your statement that "Perl's strings are a string of bytes", as there are actually two semantics: bytes and characters, especially when you have unicode in mind. (Obviously the actual storage is a stream of octets, but there are two different semantics to interpret. There is a very subtle difference in the concept of octet and byte, and probably you noticed that those two words are used very carefully nowadays in all kinds of standards.)

    I know what you meant, just thought that that pariticular statement might be a little bit too generalized.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-05-22 20:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found