| 1 | package Net::Hotline::Task; | ||||||||||
| 2 | |||||||||||
| 3 | ## Copyright(c) 1998-2002 by John C. Siracusa. All rights reserved. This | ||||||||||
| 4 | ## program is free software; you can redistribute it and/or modify it under | ||||||||||
| 5 | ## the same terms as Perl itself. | ||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | $VERSION = '0.80'; | |||||||||
| 12 | |||||||||||
| 13 | sub new | ||||||||||
| 14 | 0 | ▶ | { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 15 | 0 | my($class, @args) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 0 | my($self); | |||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | if(@args >= 3) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | { | ||||||||||
| 21 | 0 | $self = | |||||||||
| 22 | { | ||||||||||
| 23 | 'NUM' => $args[0], | ||||||||||
| 24 | 'TYPE' => $args[1], | ||||||||||
| 25 | 'START' => $args[2], | ||||||||||
| 26 | 'SOCKET' => $args[3], | ||||||||||
| 27 | 'PATH' => $args[4], | ||||||||||
| 28 | 'FINISH' => undef, | ||||||||||
| 29 | 'ERROR' => undef, | ||||||||||
| 30 | 'ERRTXT' => undef, | ||||||||||
| 31 | 'MISC' => $args[5], | ||||||||||
| 32 | }; | ||||||||||
| 33 | } | ||||||||||
| 34 | else | ||||||||||
| 35 | { | ||||||||||
| 36 | 0 | $self = | |||||||||
| 37 | { | ||||||||||
| 38 | 'NUM' => undef, | ||||||||||
| 39 | 'TYPE' => undef, | ||||||||||
| 40 | 'SOCKET' => undef, | ||||||||||
| 41 | 'PATH' => undef, | ||||||||||
| 42 | 'START' => undef, | ||||||||||
| 43 | 'FINISH' => undef, | ||||||||||
| 44 | 'ERROR' => undef, | ||||||||||
| 45 | 'ERRTXT' => undef, | ||||||||||
| 46 | 'MISC' => undef, | ||||||||||
| 47 | }; | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 0 | bless $self, $class; | |||||||||
| 51 | 0 | return $self; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | sub num | ||||||||||
| 55 | 0 | ▶ | { | ||||||||
|
Subroutine
num: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 56 | 0 | ▶ | $_[0]->{'NUM'} = $_[1] if($_[1] =~ /^\d+$/); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 0 | return $_[0]->{'NUM'}; | |||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | sub type | ||||||||||
| 61 | 0 | ▶ | { | ||||||||
|
Subroutine
type: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 62 | 0 | ▶ | $_[0]->{'TYPE'} = $_[1] if(defined($_[1])); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | 0 | return $_[0]->{'TYPE'}; | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | sub path | ||||||||||
| 67 | 0 | ▶ | { | ||||||||
|
Subroutine
path: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 68 | 0 | ▶ | $_[0]->{'PATH'} = $_[1] if(defined($_[1])); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 69 | 0 | return $_[0]->{'PATH'}; | |||||||||
| 70 | } | ||||||||||
| 71 | |||||||||||
| 72 | sub socket | ||||||||||
| 73 | 0 | ▶ | { | ||||||||
|
Subroutine
socket: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 74 | 0 | ▶ | $_[0]->{'SOCKET'} = $_[1] if($_[1] =~ /^\d+$/); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 75 | 0 | return $_[0]->{'SOCKET'}; | |||||||||
| 76 | } | ||||||||||
| 77 | |||||||||||
| 78 | sub start | ||||||||||
| 79 | 0 | ▶ | { | ||||||||
|
Subroutine
start: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 80 | 0 | ▶ | $_[0]->{'START'} = $_[1] if($_[1] =~ /^\d+$/); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 81 | 0 | return $_[0]->{'START'}; | |||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | sub finish | ||||||||||
| 85 | 0 | ▶ | { | ||||||||
|
Subroutine
finish: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 86 | 0 | ▶ | $_[0]->{'FINISH'} = $_[1] if($_[1] =~ /^\d+$/); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 87 | 0 | return $_[0]->{'FINISH'}; | |||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | sub error | ||||||||||
| 91 | 0 | ▶ | { | ||||||||
|
Subroutine
error: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 92 | 0 | ▶ | $_[0]->{'ERROR'} = $_[1] if(@_ == 2); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 93 | 0 | return $_[0]->{'ERROR'}; | |||||||||
| 94 | } | ||||||||||
| 95 | |||||||||||
| 96 | sub error_text | ||||||||||
| 97 | 0 | ▶ | { | ||||||||
|
Subroutine
error_text: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 98 | 0 | ▶ | $_[0]->{'ERRTXT'} = $_[1] if(@_ == 2); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 99 | 0 | return $_[0]->{'ERRTXT'}; | |||||||||
| 100 | } | ||||||||||
| 101 | |||||||||||
| 102 | sub misc | ||||||||||
| 103 | 0 | ▶ | { | ||||||||
|
Subroutine
misc: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 104 | 0 | ▶ | $_[0]->{'MISC'} = $_[1] if(@_ == 2); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 105 | 0 | return $_[0]->{'MISC'}; | |||||||||
| 106 | } | ||||||||||
| 107 | |||||||||||
| 108 | 1 | 1; | |||||||||