#!/usr/bin/perl use warnings; use strict; use Date::Manip; use vars qw(%ipHash); my $order=0; while() { / ^((\d{1,3}\.){3}\d{1,3}) # grab the IP address into $1 \s\-\s\-\s\[ (\d\d\/\w{3}\/\d\d(\d\d\:){3}\d\d) # grab the date into $3 \s\-\d{4}\]\s"\w{1,4}\s ([\/|\w|\.|_]+) # grab the file path into $5 /x; $ipHash{$1}{'order'} = $order++; $ipHash{$1}{'path'} = $5; $ipHash{$1}{'date'} = $3; $ipHash{$1}{'timestamp'} = &UnixDate($3,"%s"); } for (sort { $ipHash{$a}{'order'} <=> $ipHash{$b}{'order'}; } keys %ipHash) { print "$_ => $ipHash{$_}{'date'}\t$ipHash{$_}{'path'}\n"; }