Remove leading and trailing spaces and tabs
[openssl.git] / util / extract-names.pl
1 #!/usr/bin/perl
2
3 $/ = "";                        # Eat a paragraph at once.
4 while(<STDIN>) {
5     chop;
6     s/\n/ /gm;
7     if (/^=head1 /) {
8         $name = 0;
9     } elsif ($name) {
10         if (/ - /) {
11             s/ - .*//;
12             s/,[ \t]+/,/g;
13             s/^[ \t]+//g;
14             s/[ \t]+$//g;
15             push @words, split ',';
16         }
17     }
18     if (/^=head1 *NAME *$/) {
19         $name = 1;
20     }
21 }
22
23 print join("\n", @words),"\n";
24