Permalink
Browse files

Some corrections.

  • Loading branch information...
1 parent 675936e commit 825b87ff2cbf6991e8a938eac51639f11735b28e @sergot committed Apr 17, 2012
Showing with 11 additions and 7 deletions.
  1. +11 −7 lib/IO/Capture/Simple.pm
View
@@ -4,11 +4,15 @@ my $stdout = $*OUT;
my $stderr = $*ERR;
my $stdin = $*IN;
-multi sub capture(Callable $code) is export {
+sub capture(Callable $code) is export {
...
}
-multi sub capture_stdout(Callable $code) is export {
+sub capture_on($target is rw) is export {
+ ...
+}
+
+sub capture_stdout(Callable $code) is export {
my $result;
my $*OUT = class {
@@ -22,15 +26,15 @@ multi sub capture_stdout(Callable $code) is export {
$result;
}
-multi sub capture_stdout_on($target is rw) is export {
+sub capture_stdout_on($target is rw) is export {
$*OUT = class {
method print(*@args) {
$target ~= @args.join;
}
}
}
-multi sub capture_stderr(Callable $code) is export {
+sub capture_stderr(Callable $code) is export {
my $result;
my $*ERR = class {
@@ -44,19 +48,19 @@ multi sub capture_stderr(Callable $code) is export {
$result;
}
-multi sub capture_stderr_on($target is rw) is export {
+sub capture_stderr_on($target is rw) is export {
$*ERR = class {
method print(*@args) {
$target ~= @args.join;
}
}
}
-multi sub capture_stdin(Callable $code) is export {
+sub capture_stdin(Callable $code) is export {
...
}
-multi sub capture_stdin($target) is export {
+sub capture_stdin_on($target) is export {
...
}

0 comments on commit 825b87f

Please sign in to comment.