[dancer-users] Capture or redirect STDOUT

igor.bujna at post.cz igor.bujna at post.cz
Thu Feb 14 09:04:59 GMT 2013


Yes :) in plackup it working :) 
Super thank you



---------- Původní zpráva ----------
Od: David Golden <xdg at xdg.me>
Datum: 13. 2. 2013
Předmět: Re: [dancer-users] Capture or redirect STDOUT

"Are you running this with the default server? IIRC, it has issues
with the standard handles.

Try with Starman:

$ plackup --server Starman myapp.pl

On Wed, Feb 13, 2013 at 11:59 AM, <igor.bujna at post.cz> wrote:
> 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
>
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>



-- 
David Golden <xdg at xdg.me>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg
_______________________________________________
dancer-users mailing list
dancer-users at dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20130214/f90ab600/attachment.htm>


More information about the dancer-users mailing list