#!/usr/bin/perl use strict; use warnings my $file = "Name.txt"; open(IN, "<", $file) or die "I cannot open a file: $file "; my %hash = (); while(my $line =){ ## reading a file line by line # here you need to put some regular expression to identify your web addresses # from regular expression extract the WWW address and put it into some variable like my $www = $1; #hey, what is my current count for some www ? my $value = $hash{$www}; #OK, cool add one to it :) $value = $value + 1; #Good, now put it back. $hash{$www} = $value; } #close file close IN; # Print my averages foreach my $key (keys %hash){ print "$key\t" . (($hash{$key}/$total)*100) . "\%\n"; # hey where did my $total come from (I'll leave that to you :))? }