Skip to content

Instantly share code, notes, and snippets.

@SpringMT
Created March 17, 2011 12:31
Show Gist options
  • Select an option

  • Save SpringMT/874248 to your computer and use it in GitHub Desktop.

Select an option

Save SpringMT/874248 to your computer and use it in GitHub Desktop.
Capture::Tiny sample
#!/usr/bin/perl
fork+exec { $cmd } @args;
use strict;
use Capture::Tiny qw(capture);
my ($stdout, $stderr) = capture {
open my $fh, "| cat";
print $fh "foo bar baz\n";
};
warn $stdout;
warn $stderr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment