Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: how to find hash keys in a string ?

by JaWi (Hermit)
on May 03, 2003 at 10:20 UTC ( [id://255292]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;                                           
    my %temphash = ( "tom" => "good", "dick" => "bad", "hary" => "ugly" );
    ...
    
    my $regexp = join('|',keys %temphash);
    print "Found: [$1]\n" while ( $temp =~ /($regexp)/cg );
    
  2. or download this
    Found: [tom]
    Found: [dick]
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2024-04-23 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found