Today around 1:52pm, Tom Christiansen hammered out this masterpiece:

: >Has anyone read RFC #11,112,006,825,558,016?
: 
: It's rather difficult to keep up with them all, or read them all
: retroactively when you miss a few days.  It's also hard to grep
: them (HTML is the root of all evil).  Is there an rsync server that
: will dole out the pods for us as needed?

I know this _isn't_ what you asked for, however, it seems to do the trick for
me.  Feel free to hack it up and use it.

This is a very quick hack to grep RFC's that have been posted to dev.perl.org

Since they're posted in POD format, it reduces the uglyness of grepping.

The below code produces the following when searching for RFC's that want to
eliminate bits of Perl:

[ctweten@ctweten ctweten]$ ./rfcsearch.pl eliminate 
RFC number 10 matches 4 time(s):        http://dev.perl.org/rfc/10.pod
RFC number 14 matches 1 time(s):        http://dev.perl.org/rfc/14.pod
RFC number 33 matches 2 time(s):        http://dev.perl.org/rfc/33.pod
RFC number 34 matches 1 time(s):        http://dev.perl.org/rfc/34.pod
RFC number 47 matches 1 time(s):        http://dev.perl.org/rfc/47.pod
RFC number 57 matches 1 time(s):        http://dev.perl.org/rfc/57.pod
RFC number 68 matches 2 time(s):        http://dev.perl.org/rfc/68.pod
RFC number 106 matches 2 time(s):       http://dev.perl.org/rfc/106.pod
RFC number 138 matches 2 time(s):       http://dev.perl.org/rfc/138.pod
RFC number 142 matches 1 time(s):       http://dev.perl.org/rfc/142.pod
RFC number 144 matches 1 time(s):       http://dev.perl.org/rfc/144.pod
RFC number 164 matches 2 time(s):       http://dev.perl.org/rfc/164.pod
RFC number 167 matches 1 time(s):       http://dev.perl.org/rfc/167.pod
RFC number 168 matches 1 time(s):       http://dev.perl.org/rfc/168.pod
RFC number 179 matches 1 time(s):       http://dev.perl.org/rfc/179.pod
[ctweten@ctweten ctweten]$ 


#!/usr/local/bin/perl -w
use strict;
$|++;

use LWP::Simple;

my $string      = $ARGV[0] or print "Usage: $0 search_pattern\n" && exit;

my $rfcroot     = 'http://dev.perl.org/rfc/';

my $rfclist     = $rfcroot . 'index.html';

my $rfclistpage = get( $rfclist );

my $rfcpages    = [ map { /HREF="(\d+)\.pod"/ } split /\n/, $rfclistpage ];

foreach my $rfcnumber ( @{ $rfcpages } ) {
  my $rfcpage = get( $rfcroot . $rfcnumber . '.pod' );
  my $matched = $rfcpage =~ s/$string//isgo;
  print qq(RFC number $rfcnumber matches $matched
time(s):\t$rfcroot$rfcnumber.pod\n) if $matched;
}

__END__

-- 

print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>

Reply via email to