I was thinking of such solution, but I simply do not know where to put that path of code. Because the HTML is generated only after it returns to .PL.

in .PL i use createBarchart and doesn't have any output, since he creates the file with:

open ($outfile, ">", $dir.$filename)||die "Couldnt open the file!\n" +; (@outputHead) = createHeader($outfile,$filename); print $outfile " @outputHead\n"; print $outfile " [@legendArrayBAR],\n"; for($j=0; $j<$rows;$j++){ print $outfile "['$valueMatrixBAR[$j][0]'," +; for($i=0; $i<$cols-1;$i++){ print $outfile " $valueMatrixBAR[$j +][$i+1],"; if($loop_cou +nt == $cols-2){ $line +=~ s/,+$//; } $loop_count++; } print $outfile "],\n"; } print $outfile " ]); var options = { 'width': 800, 'height': 400, title: '$title', hAxis: {title: 'Sprint', titleTextStyle: {color +: 'red'}} };\n var chart = new google.visualization.ColumnChart( +document.getElementById('chart_div')); chart.draw(data, options); }\n"; (@outputFoot) =createFooter($outfile,\@CustomerList,\@SprintList,$fi +lename); print $outfile "@outputFoot\n"; #print "Finished writting a file\n"; close ($outfile);

I hope this code won't confuse you. It has to be like that, so it can be used generally, not just for this case. But there might be sometimes a new Database, and everything I need to add then is the unique ID of that database, and everything should work like that.


In reply to Re^2: Problem with creating Files (maybe) by David92
in thread Problem with creating Files by David92

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.