[Dancer-users] Capturing STDOUT of an external program in a Route handler

Gurunandan Bhat gbhat at pobox.com
Wed Sep 26 17:08:06 CEST 2012


Hi,

I need to run an external command from within a route handler and read both
STDOUT and the return value. I am currently using
Capture::Tiny<https://metacpan.org/module/Capture::Tiny>to do this.

my ($stdout, $stderr, $retval) = capture {
 # my code here ...
};

I find however that while STDERR is captured correctly, STDOUT goes to the
screen log (I am running in development mode, but production mode does not
change anything). Is there some way to capture STDOUT rather than have it
redirected to my log?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20120926/5a65562c/attachment.htm>


More information about the Dancer-users mailing list