Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Arithmatic operation in PERL

by CharlesClarkson (Curate)
on Nov 20, 2001 at 04:31 UTC ( #126432=note: print w/ replies, xml ) Need Help??


in reply to Arithmatic operation in PERL

TIMTOWTDI

my %movies; { local $/ = "\n\n"; while ( <DATA> ) { next unless s/\*\s+Movie="([^"]+)"\s+show=(\d+)//; $movies{$1}{$2} += $_ for 0, grep $_ > 20, split ' '; } print Dumper \%movies; } __END__ * Movie="ABC" show=4 10 20 30 14 90 30 21 13 11 10 09 23 22 05 22 15 19 20 * Movie="XYZ" show=4 10 20 30 14 90 30 21 13 11 10 09 23 22 05 22 15 19 10 * Movie="abc" show=4 10 10 10 14 10 10 11 13 11 10 09 13 12 05 12 15 19 10



HTH,
Charles K. Clarkson


Language is the dress of thought.
- Samuel Johnson


Comment on Re: Arithmatic operation in PERL
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-12-20 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (94 votes), past polls