| 1 | package Template::Plugin::IO::All; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use base qw( Template::Plugin ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use IO::All; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | #use Data::Dumper; | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | $Template::Plugin::IO::All::VERSION = '0.01'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | sub load { | ||||||||||||||||||||||||||
|
Subroutine
load: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 12 | 1 | my ($class, $context) = @_; | |||||||||||||||||||||||||||
| 13 | 1 | bless { | |||||||||||||||||||||||||||
| 14 | _CONTEXT => $context, | ||||||||||||||||||||||||||||
| 15 | }, $class; | ||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | 3 | my ($self, $context, @params) = @_; | |||||||||||||||||||||||||||
| 20 | 3 | ▶ | if($context and not ref $context){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$context and not ref $context
MC/DC50%1/2
$context and not ref $context
$context
not ref $context
Truth table66%2/3
A and not(B)
A= $contextB= not ref $context
| |||||||||||||||||||||||||||||
| 21 | 2 | $self->{_io} = io($context); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 3 | $self; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 8 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 28 | 8 | my $sub = $Template::Plugin::IO::All::AUTOLOAD; | |||||||||||||||||||||||||||
| 29 | 8 | $sub =~ s/^Template::Plugin::IO::All:://o; | |||||||||||||||||||||||||||
| 30 | # print "[$sub]\n"; | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 8 | ▶ | if($sub =~ /^([+\-]?\d+)$/){ # Access content on a certain line | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 33 | 1 | shift->{_io}->[$1]; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | elsif($sub ne 'DESTROY'){ | ||||||||||||||||||||||||||||
| 36 | 7 | shift->{_io}->$sub(@_); | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | 1; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||||||||||