File: extract-names.pl

package info (click to toggle)
openssl 0.9.8c-4etch9
  • links: PTS
  • area: main
  • in suites: etch
  • size: 19,340 kB
  • ctags: 26,395
  • sloc: ansic: 203,603; perl: 18,445; makefile: 10,732; asm: 10,675; cpp: 4,379; sh: 2,925; lisp: 23
file content (26 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/local/bin/perl

$/ = "";			# Eat a paragraph at once.
while(<STDIN>) {
    chop;
    s/\n/ /gm;
    if (/^=head1 /) {
	$name = 0;
    } elsif ($name) {
	if (/ - /) {
	    s/ - .*//;
	    s/,\s+/,/g;
	    s/\s+,/,/g;
	    s/^\s+//g;
	    s/\s+$//g;
	    s/\s/_/g;
	    push @words, split ',';
	}
    }
    if (/^=head1 *NAME *$/) {
	$name = 1;
    }
}

print join("\n", @words),"\n";