summaryrefslogtreecommitdiff
path: root/perl5
diff options
context:
space:
mode:
Diffstat (limited to 'perl5')
-rw-r--r--perl5/Local/Interactive.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/perl5/Local/Interactive.pm b/perl5/Local/Interactive.pm
index 0c634091..df6cdc32 100644
--- a/perl5/Local/Interactive.pm
+++ b/perl5/Local/Interactive.pm
@@ -221,7 +221,7 @@ sub _sysptycap_pty {
exec @_;
}
$pty->close;
- my $output;
+ my $return = {};
while (1) {
my $rin = "";
vec($rin, fileno $slave, 1) = 1;
@@ -229,7 +229,7 @@ sub _sysptycap_pty {
my $nbytes = sysread $slave, my $bytes, 8192;
last if defined $nbytes and $nbytes == 0;
print $bytes;
- $output .= $bytes;
+ $return->{output} .= $bytes;
} else {
# Since there was no new output, see if child needs
# reaping, and end the loop if all children have died.
@@ -248,9 +248,10 @@ sub _sysptycap_pty {
# since sysread was raw bytes, want to decode if possible
my $codeset = eval { langinfo CODESET };
- $output = decode $codeset, $output if $codeset;
+ $return->{output} = decode $codeset, $return->{output} if $codeset;
- return { exit => $? >> 8, output => $output };
+ $return->{exit} = $? >> 8;
+ return $return;
}
=head prompt($prompt)