ido50 has asked for the wisdom of the Perl Monks concerning the following question:

Hi there.
I've been trying to use Pod::Tree::HTML to create HTML pages from the POD in a CGI program I'm writing.
At first, I've tried doing this with the following code:
sub pod { my ($class, $source, $dest) = @_; my $html = Pod::Tree::HTML->new($source, $dest); $html->translate; open(HTML, $dest) or die "Can't open HTML for $source: $!"; flock(HTML, LOCK_SH); print $cgi_query->header; foreach (<HTML>) { chomp; print; } close(HTML); }
where $source and $dest are the paths to the source file and destination file. Performing this routine on any module from my program would result in the following HTML file:
<html><body></body></html>
So I've tried to do it a little differently by first creating a new Pod::Tree and then using new Pod::Tree::HTML on the tree, but got the same result. I've used Pod::Tree's dump subroutine to see the tree, but it was empty.

Using Perl's pod2html program on the modules of my program creates the HTML pages without any problem so I don't think there's a problem with my POD.

Any suggestions?

-------------------------
Live fat, die young

Replies are listed 'Best First'.
Re: Pod::Tree::HTML
by bibo (Pilgrim) on Jul 06, 2004 at 18:54 UTC
    Well, you are not showing us much info about the arguments to pod() but I wonder about permissions in your web environment? Perhaps you are setting $dest to be something outside the docroot which the web server will not allow? Any luck just creating the file specified in $dest with a bit of text in it??

    --bibo

      As I've said (Or maybe was not too clear about it, sorry), the destination file is created, but only with the following text (HTML):
      <html><body></body></html>
      So there's no problem with the $dest path.
      I've also double checked that $source holds the correct source path...

      -------------------------
      Live fat, die young