From 7265718f0ae8b2c178b79a5f47dfb33bcc0b4834 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Wed, 31 Dec 2014 13:24:41 -0500 Subject: [PATCH] Don't die automatically on lines that don't match. Instead, move on and don't count anything that isn't a GET. --- oggcast-count.plx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oggcast-count.plx b/oggcast-count.plx index 4e23749..e33b1a8 100755 --- a/oggcast-count.plx +++ b/oggcast-count.plx @@ -22,8 +22,9 @@ my %data; while (<>) { chomp; - die "invalid line: $_" - unless /^(\S+)\s+[^"]+"\s*(HEAD|GET|POST|OPTIONS|PUT|CONNECT|PROPFIND)\s+(\S+)[\s"]/; + next unless /^(\S+)\s+[^"]+"\s*(GET)\s+(\S+)[\s"]/; +# die "invalid line: $_" +# unless /^(\S+)\s+[^"]+"\s*(LOCK|HEAD|GET|POST|OPTIONS|PUT|CONNECT|PROPFIND)\s+(\S+)[\s"]/; my($ip, $method, $url) = ($1, $2, $3); next unless $method =~ /^\s*GET\s*$/i;