Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Simple answer is no.

A Perl ASCII string is pretty much like a string in 'C'. This is a sequence of bytes in memory terminated by a x00 byte. Each character is encoded as one byte. In Perl you will never come across this last "null" byte.For fancy multi-byte character sets, I defer to wiser Monks than me.

In a 'C' or a Perl string, you will come across things like \n and \r. That backslash means, "hey this is NOT an "n" or an "r", this is something special and means 0x0A (new line) or 0x0D (carriage return) respectively.

In a Perl string, if you want something that otherwise would have a meaning, like the double quote character " to be taken literally (not part of Perl's translations), you put a \ in front of it.

print " this is a double quote, a \" \n";
In other words, this backslash thing means that the character which follows should be interpreted with a special meaning, if there is any such meaning. In the above, the backslash before the double quote (") means, hey this is not the end of the print statement quote, but rather please print literally a double quote. The \n means: this is not an "n", but rather a 0x0A character.

I guess this as clear as mud, but I tried.

Updated with some strike-thru's.


In reply to Re: Perl5 Internal Representation of string variable by Marshall
in thread Perl5 Internal Representation of string variable by flexvault

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found