my $holder; sub command { open local(*STDOUT), '>', \$holder; your_system_command; }