Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: quotes in Perl

by TheEnigma (Pilgrim)
on Oct 20, 2004 at 23:10 UTC ( #401011=note: print w/ replies, xml ) Need Help??


in reply to quotes in Perl

Well done!

You might want to add, however, that with q, qq, and qw, delimiters other than parentheses can be used. [] and {} will work, as will just about any punctuation mark, I believe. Then, to use your delimiter within the quoted string, the rule would be: escape whatever your delimiter is.

TheEnigma


Comment on Re: quotes in Perl
Select or Download Code
Replies are listed 'Best First'.
Re^2: quotes in Perl
by revdiablo (Prior) on Oct 21, 2004 at 05:07 UTC
    just about any punctuation mark

    Actually, you can use almost any character, not just punctuation. The only thing is, with alpha delimiters, you need a space between the operator and the delimiter. This can be used for all manner of nefarious purposes. Quick example:

    $_ = qq qHelloq; s sHss; print y yyyc;
Re^2: quotes in Perl
by apotheon (Deacon) on Oct 20, 2004 at 23:20 UTC
    I knew I'd forget something. Thanks for the reminder. I'll get right on that.

    - apotheon
    CopyWrite Chad Perrin

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-29 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls