File: extract-methods

package info (click to toggle)
libcgi-psgi-perl 0.15-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 220 kB
  • sloc: perl: 1,586; makefile: 2
file content (14 lines) | stat: -rwxr-xr-x 319 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!perl
chomp(my $file = `perldoc -l CGI`);
open my $io, "<", $file or die $!;

my $sub;
while (<$io>) {
    chomp;
    /^sub (\w+)/ and $sub = $1;
    /^}\s*$/ and do {
        print "$sub\n" if $code{$sub} =~ /([\%\$]ENV|http\()/; undef $sub
    };
   $code{$sub} .= "$_\n" if $sub;
    /^\s*package [^C]/ and exit;
}