Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 scrutinizing the Monastery: (6)
As of 2019-10-20 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?