<html><body>Hi,<br>i want to capture STDOUT under my Dancer applications with package Capture::Tiny. I have this simple Perl test:<span class="sh_keyword"><br><br></span><span class="sh_keyword">--------------------------------------------------------------------------------------------------------</span><br><span class="sh_keyword">use Capture::Tiny;<br>my ($stdout, $stderr, $exit) = Capture::Tiny::capture {<br> system( "echo 'OK'");<br>};<br>print STDERR "Captured:$stdout\n";<br></span><span class="sh_keyword">--------------------------------------------------------------------------------------------------------<br><br></span><span class="sh_keyword">Capturing STDOUT in this script is ok, but when i move to Dancer app, that this faill. System print command to STDERR and nothing is captured.<br><br>--------------------------------------------------------------------------------------------------------<br>package Test;<br>use Dancer ':syntax';<br></span><span class="sh_keyword">use Capture::Tiny;<br><br></span><span class="sh_keyword">our $VERSION = '0.1';<br><br>get '/' => sub {<br> my ($stdout, $stderr, $exit) = Capture::Tiny::capture {<br> system( "echo 'OK'");<br> };<br> print STDERR "Captired:$stdout\n";<br> template 'index';<br>};<br>true;<br></span><span class="sh_keyword">--------------------------------------------------------------------------------------------------------</span><br><span class="sh_keyword"><br>Why or where system/fork redirect STDOUT to STDERR ? How can I capture this under dancer. Maybe it will be possible to change system() call to own function, where can use IPC::Open3, but how can i made it?<br><br>Thank you for yours suggestion Igor <br><br><br></span><span class="sh_keyword"></span></body></html>