Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Problem w/ single-quoted strings

by eweibust (Initiate)
on May 14, 2004 at 18:23 UTC ( [id://353443]=note: print w/replies, xml ) Need Help??


in reply to Re: Problem w/ single-quoted strings
in thread Problem w/ single-quoted strings

Stevie-O,

Very good post. Let me try to break it down.

Case 1. Simply means you get what's b/t the single-quotes when there aren't any backslashes (complicating things).

Case 2. Is an exception that allows you to use your termination character inside your string. To do this an "evil" backslash is used. You only get the term char in your string; the backslash disappears....

Case 3. I guess is a way to get a backslash into your string by using two consecutive backslashes. This confuses me b/c....

Case 4. Says that a backslash that is followed by anything other then a backslash or term char adds the backslash and the char following it. To me this seems redundant, b/c Case 3 also got you a backslash in your string.

I am posting some code as an example.
print 'case 3 ','Test\\ing'; print "\n"; print 'case 4 ','Test\ing'; print "\n"; erikweibust@daleweibust ~/perl/lrn_perl $ ./test2.pl case 3 Test\ing case 4 Test\ing

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found