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

I have been trying to embed Pod::Html into the code below. However, when running said code the following error is displayed Bizarre copy of ARRAY in list assignment at C:/Perl64/site/lib/Carp.pm line 228 <DATA> Any thoughts?
{ my ( $tmp_fh, $tmp_file ) = tempfile( UNLINK => 1 ); my @data = <DATA>; print $tmp_fh @data; close $tmp_fh; $tmp_fh->autoflush; my $out_file = "${file_name}.html"; my $title = $file_name . $suffix; pod2html("pod2html","--backlink", "-infile=$tmp_file", "-outfi +le=$out_file", "title=$title", "--verbose" ); }
Chaz Ubell "Running to stay in place"

Replies are listed 'Best First'.
Re: Embedding Pod::HTM in a Script
by McA (Priest) on Nov 17, 2014 at 15:46 UTC

    Hi,

    my thoughts:

    • Where is line number 228?
    • You should be able to strip down your problem to a very minimal (not) working example to debug your problem.
    • Why do you want to read from DATA? POD is usually everywhere in the script file. So, I'm pretty sure you should send the content of the script to pod2html.

    Regards
    McA

Re: Embedding Pod::HTM in a Script
by Anonymous Monk on Nov 18, 2014 at 00:55 UTC

    I have been trying to embed Pod::Html into the code below.

    What do you mean by "embed" ?

      What I wanted to do, in a single file, was include some documentation after the Perl code. That is place some POD formatted documentation within the __DATA__ section of the file. The file was to then be processed by pod2html from Pod::Html. However that did not work. (I wanted to avoid starting an addition process).

      The motivation for this was to have all the end-user needed contained in a single file. If they wanted to view the full documentation all that would be needed would be to run the script with an --html option on the command line and the output to then send the full documentation to a web browser.

      BTW: I have it all working :-)

      Thanks for looking into my problem.

      Chaz Ubell "Running to stay in place"