Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

The name of the character

by KurtSchwind (Chaplain)
on Aug 06, 2015 at 15:51 UTC ( [id://1137706]=perlquestion: print w/replies, xml ) Need Help??

KurtSchwind has asked for the wisdom of the Perl Monks concerning the following question:

I was just showing a non-native english speaking colleague the quote function in perl.

my $x = q(Some string of stuff keeping $signs in tact);

And I mentioned that you could change the parens to curly braces or a slew of other characters and he asked me what the name of the character that follows the q is. My first instinct was to say delimiter but that's not quite right because a delimiter repeats and parens and curly braces close with the opposing brace or paren.

my $x = q{Test}; my $x = q+Test+; my $x = q(Test); my $x = q^Test^; ...

So. Does the name of the character after the q have a specific name? As in "You can change the ____ from a parenthesis to a plus sign."

--
“For the Present is the point at which time touches eternity.” - CS Lewis

Replies are listed 'Best First'.
Re: The name of the character
by stevieb (Canon) on Aug 06, 2015 at 15:55 UTC

    perlop says this:

    "Perl provides customary quote characters for these behaviors, but also provides a way for you to choose your quote character for any of them. In the following table, a {} represents any pair of delimiters you choose."
Re: The name of the character
by toolic (Bishop) on Aug 06, 2015 at 15:56 UTC
    Quote and Quote like Operators:
    ... a {} represents any pair of delimiters you choose. Non-bracketing delimiters use the same character fore and aft, but the four sorts of ASCII brackets (round, angle, square, curly) ...
Re: The name of the character
by kennethk (Abbot) on Aug 06, 2015 at 15:55 UTC
    I would say bracket, but that's actually more limiting than Perl is (e.g., q# ... #). It still is a delimiter, since it separates the quoted string from the surrounding text.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Re: The name of the character
by ww (Archbishop) on Aug 06, 2015 at 18:06 UTC

    "Paren" may or may not be legitimized by by all dictionaries (some identify it as a mere abbreviation)... but FWIW http://www.merriam-webster.com/dictionary/paren is ok with the use and, in any case whether the academically-minded like it or not, "open paren" unambiguously names the character in question, while "close paren" fits well on its mate.



Re: The name of the character
by KurtSchwind (Chaplain) on Aug 06, 2015 at 17:27 UTC

    Thanks much. I guess I if thought about it as delimiter and 'delimiter pairs' that would have helped me.

    Love this site.

    --
    “For the Present is the point at which time touches eternity.” - CS Lewis
Re: The name of the character
by BillKSmith (Monsignor) on Aug 07, 2015 at 03:11 UTC

    A google search for a table of Unicode character names found http://unicode.org/charts/charindex.html. The name given for character code 007D 007B is "brace, opening".

    UPDATE: Corrected character code. See WW's comments for additional corrections and details.

    Bill

      Not so: "brace, opening" is listed as 007B.

      That table names 007D (0x007d) as "RIGHT CORNER BRACKET," "CURLY BRACKET, RIGHT," "bracket, closing curly," & "brace, closing." None of those match the opening paren the OP asked about.

      Update: "PARENTHESIS, LEFT" and "parenthesis, opening" (and perhaps others?) are listed as "0028." The difference in words and capitalization is explained by the nice folks who built the chart (based on "The Unicode Standard, Version 8.0") at http://www.unicode.org/charts/aboutcharindex.html which characterizes lower-case listings as "Alternative character names (aliases)" while all-UPPER listings are "Formal character names."

        by the nice folks who built the chart

        just a note, the folks who built the Unicode Standard are equally nice folks, wise guys and a bit funny too, which is consistent with F00 (0xf00) being ༀ - the holy syllable OM in tibetan writing. Mind this, every time you use $foo, $f00 or such..

        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found