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

Re: Matching multiple {hits}

by Anonyrnous Monk (Hermit)
on Feb 13, 2011 at 19:20 UTC ( #887889=note: print w/ replies, xml ) Need Help??


in reply to Matching multiple {hits}

#!/usr/bin/perl -w use strict; my %customers; while (my $line = <DATA>) { while ($line =~ m/{(.*?)}/g) { my $customer_name = $1; $customers{ $customer_name }++; } } use Data::Dumper; print Dumper \%customers; __DATA__ AB1\tA{Daniel Wright}\sA{Jack Smith}\sB{Jane Goodwin} QW1\tA{Samantha Patton}\sC{Timothy Eeckles} AR2\tA{Jane Goodwin}
$VAR1 = { 'Jane Goodwin' => 2, 'Daniel Wright' => 1, 'Timothy Eeckles' => 1, 'Jack Smith' => 1, 'Samantha Patton' => 1 };


Comment on Re: Matching multiple {hits}
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (18)
As of 2014-09-22 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls