Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Counting the Times Two Unknown Values Appear Together

by naikonta (Curate)
on Jul 15, 2007 at 03:08 UTC ( #626682=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %count;
    my $total;
    ...
    
    # iterate %count to see how many the pattern shows up on each line
    # $total is the total number the pattern shows up in the file
    
  2. or download this
    my(%count, $total);
    while (<FILE>) {
    ...
      $count{$.} = $seen{$target};
      $total += $seen{$target};
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2019-02-19 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I use postfix dereferencing ...









    Results (105 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!