Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-24 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found