#!/usr/bin/perl # Calculate the time difference between every download of a paper # and every citation on a paper # Author: Ian Hickman use strict; my (%table, @cits, @hits); while( ){ @cits=split; $_=; @hits=split; for( my $c=2; $c<@cits; $c++ ){ for( my $h=3; $h<@hits; $h++ ){ my $r=($hits[$h]-$cits[$c]); $table{$r}++; } } } my $time; foreach $time ( keys ( %table )){ print"$time $table{$time}\n"; }