Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Pattern matching with hash keys

by prasadbabu (Prior)
on Oct 04, 2010 at 06:18 UTC ( #863262=note: print w/ replies, xml ) Need Help??


in reply to Pattern matching with hash keys

Hi tej,
Replace "=" with "=>" or ",". For example:

%hash = ("rabbit" => "test"); $string = "rabbit"; if ($string =~ /rabbit/){ $string = $hash{"rabbit"}; }

Prasad


Comment on Re: Pattern matching with hash keys
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (17)
As of 2015-07-28 14:05 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 (255 votes), past polls