#!/usr/bin/perl # Calculate the session length distribution (number of hits) # Author: Ian Hickman use strict; my $c=0; my (%table, $key); while( ){ # remove newline chomp( $_ ); # if in a session if( $_ ne "" ){ $c++; } else { $table{$c}++; $c=0; } } foreach $key ( keys ( %table )){ print"$key $table{$key}\n"; }