Help for this page

Select Code to Download


  1. or download this
    if ( $line =~ m@Users of Product@ ) {
           $line =~ m@Product(\d+):@;  # match and capture product number 
           $product = $1l
    
  2. or download this
    $line = s/\s+//; #get rid of the leading spaces
    my @f=split(/[\s\t]+/,$line);
    ...
    $counter{$user} = [] if ( ! defined($counter{$user}) ) ;
    
    $counter{$user}->{$product}++;