summaryrefslogtreecommitdiff
path: root/pod/splitpod
diff options
context:
space:
mode:
Diffstat (limited to 'pod/splitpod')
-rw-r--r--pod/splitpod47
1 files changed, 47 insertions, 0 deletions
diff --git a/pod/splitpod b/pod/splitpod
new file mode 100644
index 0000000000..fd327d80da
--- /dev/null
+++ b/pod/splitpod
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use PerlDoc::Functions;
+
+local $/ = '';
+
+$cur = '';
+while (<>) {
+
+ next unless /^=(?!cut)/ .. /^=cut/;
+
+ if (s/=item (\S+)/$1/) {
+ #$cur = "POSIX::" . $1;
+ $cur = $1;
+ $syn{$cur} .= $_;
+ next;
+ } else {
+ #s,L</,L<POSIX/,g;
+ s,L</,L<perlfunc/,g;
+ $pod{$cur} .= $_ if $cur;
+ }
+}
+
+for $f ( keys %syn ) {
+ $type = $Type{$f} || next;
+ $flavor = $Flavor{$f};
+ $orig = $f;
+ ($name = $f) =~ s/\W//g;
+ open (POD, "> $name.pod") || die "can't open $name.pod: $!";
+ print POD <<EOF;
+=head1 NAME
+
+$orig - $flavor
+
+=head1 SYNOPSIS
+
+$syn{$orig}
+
+=head1 DESCRIPTION
+
+$pod{$orig}
+
+EOF
+
+ close POD;
+
+}