Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 };

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 scrutinizing the Monastery: (8)
As of 2016-09-30 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.