| 1 | package IPC::Simple::Message; | ||
| 2 | # ABSTRACT: a message received from an IPC::Simple process | ||
| 3 | 4 | $IPC::Simple::Message::VERSION = '0.08'; | |
| 4 | |||
| 5 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 4 | use overload fallback => 1, | |
| 9 | 4 | ▶ | '""' => \&message; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 4 | ▶ | use constant IPC_STDIN => 'stdin'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 4 | ▶ | use constant IPC_STDOUT => 'stdout'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 4 | ▶ | use constant IPC_STDERR => 'stderr'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 4 | ▶ | use constant IPC_ERROR => 'errors'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | BEGIN{ | ||
| 17 | 4 | ▶ | use base 'Exporter'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | 4 | ▶ | our @EXPORT = qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | IPC_STDIN | ||
| 21 | IPC_STDOUT | ||
| 22 | IPC_STDERR | ||
| 23 | IPC_ERROR | ||
| 24 | ); | ||
| 25 | } | ||
| 26 | |||
| 27 | sub new { | ||
| 28 | 6 | ▶ | my ($class, %param) = @_; |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 29 | |||
| 30 | bless{ | ||
| 31 | source => $param{source}, | ||
| 32 | type => $param{type}, | ||
| 33 | message => $param{message}, | ||
| 34 | 6 | }, $class; | |
| 35 | } | ||
| 36 | |||
| 37 | 12 | ▶ | sub type { $_[0]->{type} } |
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 38 | 6 | ▶ | sub source { $_[0]->{source} } |
|
Subroutine
source: called CC=1 SCAR=0.0
Pod
documented
| |||
| 39 | 10 | ▶ | sub message { $_[0]->{message} } |
|
Subroutine
message: called CC=1 SCAR=0.0
Pod
documented
| |||
| 40 | 6 | ▶ | sub stdout { $_[0]->type eq IPC_STDOUT } |
|
Subroutine
stdout: called CC=1 SCAR=0.0
Pod
documented
| |||
| 41 | 2 | ▶ | sub stderr { $_[0]->type eq IPC_STDERR } |
|
Subroutine
stderr: called CC=1 SCAR=0.0
Pod
documented
| |||
| 42 | 4 | ▶ | sub error { $_[0]->type eq IPC_ERROR } |
|
Subroutine
error: called CC=1 SCAR=0.0
Pod
documented
| |||
| 43 | |||
| 44 | 4 | 1; | |
| 45 | |||
| 46 | __END__ | ||