in reply to capturing stderr of echo piped to a file
use system with use Capture::Tiny
use Capture::Tiny qw/ capture /; my($stdout, $stderr, $exit) = capture { system { $args[0] } @args; };;
In Section
Seekers of Perl Wisdom