Skip to content

Instantly share code, notes, and snippets.

@jberger
Created July 27, 2012 20:59
Show Gist options
  • Select an option

  • Save jberger/3190457 to your computer and use it in GitHub Desktop.

Select an option

Save jberger/3190457 to your computer and use it in GitHub Desktop.
PerlTuts Dev API example
my ($stdout, $stderr, $result) = capture { eval $string };
my %return = (
stdout => $stdout,
stderr => $stderr,
);
if (ref $results eq 'HASH') {
$return{$_} => $results{$_} for keys %$results;
}
send(encode_json(\%return));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment