#!/usr/bin/perl -w use strict; my(%scraped,%inboth); for () { next if /tmp/; my $mod = -M; s/cmpages\/(.*?)\..*/$1/; $scraped{$_} = $mod; } my (%xmlolder, %xmlonly, %htmlonly); for () { next if /divisionsonly/; my $mod = -M; s/scrapedxml\/(.*?)\/([a-z]+)(.*?)\..*/$1\/$2$3/; my $cat = $1; my $date = $3; if ($scraped{$_}) { if ($mod>$scraped{$_}) { push @{$xmlolder{$cat}}, $date; } $inboth{$_} = 1; } else { push @{$xmlonly{$cat}}, $date; } } foreach (sort keys %scraped) { /^(.*?)\/([a-z]+)(.*)$/; my $cat = $1; my $date = $3; if (!$inboth{$_}) { push @{$htmlonly{$cat}}, $date; } } display('XML older than HTML', %xmlolder) if (%xmlolder); display('Only in XML', %xmlonly) if (%xmlonly); display('Only in HTML', %htmlonly) if (%htmlonly); sub display { my($title,%hash) = @_; print "$title\n" . '~' x length($title) . "\n"; foreach (keys %hash) { print "$_ : " . join(', ', @{$hash{$_}}) . "\n"; } print "\n"; }