#!/usr/bin/perl -ws use strict; use Data::Dumper; our ($dom,$tab); #undef $/; #$/=''; my %red=(); my $ok=1; my $url; while(<>){ if(m{^--\d\d:\d\d:\d\d--\s*https?://(.*)}) { $ok = 0; $url=$1; next if $dom && !($url =~ m{^$dom}) ; print "}\n\n{url => '$url',\n" unless $tab; $ok = 1; } if($ok && /^\s*=>\s*`(.*)'/) { print "file => '$1',\n" unless $tab} if($ok && /^Location:\s*https?:\/\/(.*?) \[following\]/){ $red{$url}=$1; print "redirect => '$1',\n" unless $tab} if($ok && /^Length:\s*(.*?) \[(.*?)\]/) { print "length => '$1',\ntype => '$2'\n" unless $tab} } print Dumper(\%red) if $tab __END__