Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to escape # sign in key name

by bmcatt (Friar)
on May 13, 2004 at 16:42 UTC ( #353141=note: print w/replies, xml ) Need Help??


in reply to How to escape # sign in key name

I think the problem is that you're hoping for too much intelligence on the part of =>. When perl (Perl?) sees the bare '#', it assumes it's an end-of-line comment. If, however, you quote the key, it works fine.

#!/usr/bin/perl -w use strict; my %hash = ( partname => "large widget", 'cata#ofitem' => "4321" ); print $hash{ 'cata#ofitem' }, "\n";

correctly reports "4321" as expected.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2022-01-24 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (65 votes). Check out past polls.

    Notices?