#!/usr/bin/perl
        # usage: webgrep PATTERN urls...
        use LWP::Simple 'get';
        my $pat = shift;
        my @contexts;
        for my $url (@ARGV) {
          my $doc = get($url);
          unless (defined $doc) {
            warn "Couldn't fetch $doc; skipping\n";
            next;
          }

          while ($doc =~ m/$pat/oig) {
            push @contexts, substr($doc, pos($doc) - 30, 60);
          }
        }
        print join("\n--------\n", @contexts), "\n";

