#!/usr/bin/perl -w use strict; my $line = '76.172.202.159 - - [31/Aug/2007:15:58:15 -0600] "GET / HTTP/1.1" 200 29692 "http://www.paperbackswap.com/forum/view_topic.php?t=70235&ls=" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12"'; my ($host,$date,$url_with_method,$status,$size,$referrer,$agent) = $line =~ m/^(\S+) - - \[(\S+ \+\d{4})\] "(\S+ \S+ [^"]+)" (\d{3}) (\d+|-) "(.*?)" "([^"]+)"$/; print "$host\n$date\n$url_with_method\n$status\n$size\n$referrer\n$agent\n";