<div dir="ltr"><div>Hello Dancers,</div><div><br></div>Is it possible to print web page output directly using Dancer2?<div><br></div><div>I'm using Text::CSV_XS to output DB data as CSV like so:</div><div><br></div><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>while ( my $row = $sth->fetch ) {<br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">         </span>$csv->print ( $io, $row );</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>}</div><div><br></div><div>where $io is a file handle, socket, etc.</div><div><br></div></div><div>At the moment, I'm creating a temp file, writing the data, and then using send_file to dispatch the data. Ideally I'd like to just print it straight to the web output, but (e.g.) setting $io to *STDOUT does not work, and there is no serialiser for csv or plain text.</div><div><br></div><div>Is there a shortcut that I'm missing?</div><div><br></div><div>Thanks!</div></div>