You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by ma...@sergeant.org on 2006/08/16 00:47:57 UTC

[SVN] [85] Support showing docs for any perl module

Revision: 85
Author:   matt
Date:     2006-08-15 22:47:40 +0000 (Tue, 15 Aug 2006)

Log Message:
-----------
Support showing docs for any perl module

Modified Paths:
--------------
    trunk/plugins/demo/doc_viewer

Modified: trunk/plugins/demo/doc_viewer
===================================================================
--- trunk/plugins/demo/doc_viewer	2006-08-15 22:37:33 UTC (rev 84)
+++ trunk/plugins/demo/doc_viewer	2006-08-15 22:47:40 UTC (rev 85)
@@ -18,13 +18,17 @@
     }
     elsif ($uri =~ /::/) {
         $uri =~ s/^\///;
+        my $module = $uri;
         $uri = "lib/$uri" unless $uri =~ /plugins::/;
         $uri =~ s/::/\//g;
         $uri .= '.pm' if -e "${uri}.pm";
         $uri .= '.pod' if -e "${uri}.pod";
+        # TODO: fix this huge security hole?
+        $uri = `perldoc -l '$module'`;
     }
     else {
         # Ignore?
+        die "Unsupported URL: $uri";
     }
     
     my $builder = XML::LibXML::SAX::Builder->new();