tools/extract-methods
raw| 1 | #!perl |
| 2 | chomp(my $file = `perldoc -l CGI`); |
| 3 | open my $io, "<", $file or die $!; |
| 4 | |
| 5 | my $sub; |
| 6 | while (<$io>) { |
| 7 | chomp; |
| 8 | /^sub (\w+)/ and $sub = $1; |
| 9 | /^}\s*$/ and do { |
| 10 | print "$sub\n" if $code{$sub} =~ /([\%\$]ENV|http\()/; undef $sub |
| 11 | }; |
| 12 | $code{$sub} .= "$_\n" if $sub; |
| 13 | /^\s*package [^C]/ and exit; |
| 14 | } |