The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use IO::File;
use IO::CaptureOutput qw/qxx/;

my $output_file = shift @ARGV;

my ($stdout, $stderr) = 
    qxx($^X, '-e', 'print "STDOUT\n"; print STDERR "STDERR\n"');

my $fh = IO::File->new($output_file, ">");
print {$fh} $stdout, $stderr;
$fh->close;