Derek Romeyn wrote:
> K, I tried this and it didn't work as expected:
>
> $code =~ / HTTP\/\d\.\d\" (\d+)/;
> if (!$code) {
> print "NEXT\n";
> next;
> }
> print "$code\n";
>
>
> The loop just printed NEXT 300 or so times. I was thinking that $code
> would
> equal whatever was in the parentheses. Am I still not getting this?
top posting is bad. don't do that. respond below, or interleaved with the
post you are replying to.
while (<IN>)
{
next unless (my $file, $code) =
m|GET\s+([/.\w\d]+)\s+HTTP/[\d.]+"\s+(\d+)\s+|
print "$file: $code\n";
}
try this one on for size as a start. Does a little bit more than you asked
for but you might find that useful too. ;)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]