<html><body>Yes :) in plackup it working :) <br>Super thank you<br><br><br><p>---------- Původní zpráva ----------<br>Od: David Golden <xdg@xdg.me><br>Datum: 13. 2. 2013<br>Předmět: Re: [dancer-users] Capture or redirect STDOUT</p><br><blockquote>Are you running this with the default server? IIRC, it has issues<br>with the standard handles.<br><br>Try with Starman:<br><br> $ plackup --server Starman myapp.pl<br><br>On Wed, Feb 13, 2013 at 11:59 AM, <igor.bujna@post.cz> wrote:<br>> Hi,<br>> i want to capture STDOUT under my Dancer applications with package<br>> Capture::Tiny. I have this simple Perl test:<br>><br>> --------------------------------------------------------------------------------------------------------<br>> use Capture::Tiny;<br>> my ($stdout, $stderr, $exit) = Capture::Tiny::capture {<br>> system( "echo 'OK'");<br>> };<br>> print STDERR "Captured:$stdout\n";<br>> --------------------------------------------------------------------------------------------------------<br>><br>> Capturing STDOUT in this script is ok, but when i move to Dancer app, that<br>> this faill. System print command to STDERR and nothing is captured.<br>><br>> --------------------------------------------------------------------------------------------------------<br>> package Test;<br>> use Dancer ':syntax';<br>> use Capture::Tiny;<br>><br>> 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>> --------------------------------------------------------------------------------------------------------<br>><br>> Why or where system/fork redirect STDOUT to STDERR ? How can I capture this<br>> under dancer. Maybe it will be possible to change system() call to own<br>> function, where can use IPC::Open3, but how can i made it?<br>><br>> Thank you for yours suggestion Igor<br>><br>><br>><br>> _______________________________________________<br>> dancer-users mailing list<br>> dancer-users@dancer.pm<br>> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br>><br><br><br><br>-- <br>David Golden <xdg@xdg.me><br>Take back your inbox! → http://www.bunchmail.com/<br>Twitter/IRC: @xdg<br>_______________________________________________<br>dancer-users mailing list<br>dancer-users@dancer.pm<br>http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</blockquote></body></html>