Hi,
i want to capture STDOUT under my Dancer applications with package Capture::Tiny. I have this simple Perl test:

--------------------------------------------------------------------------------------------------------
use Capture::Tiny;
my ($stdout, $stderr, $exit) = Capture::Tiny::capture {
        system( "echo 'OK'");
};
print STDERR "Captured:$stdout\n";
--------------------------------------------------------------------------------------------------------

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.

--------------------------------------------------------------------------------------------------------
package Test;
use Dancer ':syntax';
use Capture::Tiny;

our $VERSION = '0.1';

get '/' => sub {
   my ($stdout, $stderr, $exit) = Capture::Tiny::capture {
        system( "echo 'OK'");
   };
   print STDERR "Captired:$stdout\n";
    template 'index';
};
true;
--------------------------------------------------------------------------------------------------------

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?

Thank you for yours suggestion Igor