Monday, January 3, 2011

Perl: Quote and Quote-like Operators

Customary    Generic         Meaning                   Interpolates
    ''                q{}               Literal                       no
    ""              qq{}              Literal                       yes
    ``               qx{}             Command                  yes*
                     qw{}             Word list                   no
    //               m{}              Pattern match            yes*
                     qr{}              Pattern                      yes*
                     s{}{}             Substitution               yes*
                     tr{}{}             Transliteration            no (but see below)
                   <<EOF          here-doc                    yes*

    * unless the delimiter is ''.

No comments: