« blib/lib/Devel/ebug/Backend/Plugin/Commands.pm
↑ Summary
blib/lib/Devel/ebug/Backend/Plugin/StackTrace.pm »
| 1 | package Devel::ebug::Backend::Plugin::Output; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 6 | our $VERSION = '0.69'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 6 | my $stdout = ""; | |||||||||
| 9 | 6 | my $stderr = ""; | |||||||||
| 10 | |||||||||||
| 11 | # Capture the program's output so the frontend can show it. Under | ||||||||||
| 12 | # PERL_DEBUG_DONT_RELAY_IO (ebug_server -keepio) STDOUT and STDERR are | ||||||||||
| 13 | # deliberately left going wherever they were going, so that a program | ||||||||||
| 14 | # which prompts can still be used interactively; output then has nothing | ||||||||||
| 15 | # to report. | ||||||||||
| 16 | 6 | ▶ | unless ($ENV{PERL_DEBUG_DONT_RELAY_IO}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 6 | close STDOUT; | |||||||||
| 18 | 6 | ▶ | open STDOUT, '>', \$stdout or die "Can't open STDOUT: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 6 | close STDERR; | |||||||||
| 20 | 6 | ▶ | open STDERR, '>', \$stderr or die "Can't open STDERR: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 6 | ▶ | sub register_commands { | ||||||||
|
Subroutine
register_commands: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 24 | 6 | return (output => { sub => \&output }); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub output { | ||||||||
|
Subroutine
output: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | 0 | my($req, $context) = @_; | |||||||||
| 29 | return { | ||||||||||
| 30 | 0 | stdout => $stdout, | |||||||||
| 31 | stderr => $stderr, | ||||||||||
| 32 | }; | ||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 6 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||