Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: quotation mark as key

by Corion (Patriarch)
on Aug 06, 2017 at 10:16 UTC ( [id://1196841]=note: print w/replies, xml ) Need Help??


in reply to quotation mark as key

First off, if you are using a hash reference, you need braces, not parentheses:

my $hash = { foo => 'bar', };

There are several approaches you can use.

Use single quotes for a double quote:

my $hash = { '"' => 1, };

Quote the double quote:

my $hash = { "\"" => 1, };

Use chr:

my $hash = { chr(34) => 1, };

Use alternative quotes:/p>

my $hash = { q(") => 1, };

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found