http://www.perlmonks.org?node_id=274990


in reply to Re^4: Use of IPC::Run rather than system()
in thread Use of IPC::Run rather than system()

Something like this should work:
use IPC::Run qw(run); my ($out, $err) = ('', ''); run(['/path/to/prog', @args], '>', sub { $out .= $_[0]; print $_[0] }, '2>', sub { $err .= $_[0]; print $_[0] });

--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org