| 1 | 2 | ▶ | use 5.008; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | package Template::Plugin::Filter::Pipe; | ||||||||||||
| 6 | 2 | our $VERSION = '1.100860'; | |||||||||||
| 7 | # ABSTRACT: Filter plugin adapter for Text::Pipe | ||||||||||||
| 8 | 2 | ▶ | use Text::Pipe; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 2 | ▶ | use parent qw(Template::Plugin::Filter); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 3 | ▶ | sub init { | ||||||||||
|
Subroutine
init: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 12 | 3 | my $self = shift; | |||||||||||
| 13 | 3 | $self->{_DYNAMIC} = 1; | |||||||||||
| 14 | 3 | ▶ | $self->install_filter($self->{_ARGS}[0] || 'pipe'); | ||||||||||
|
Condition50%1/2
$self->{'_ARGS'}[0] || 'pipe'
MC/DC0%0/1
$self->{'_ARGS'}[0] || 'pipe'
$self->{'_ARGS'}[0]
Truth table50%1/2
A
A= $self->{'_ARGS'}[0]
| |||||||||||||
| 15 | 3 | $self; | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 5 | ▶ | sub filter { | ||||||||||
|
Subroutine
filter: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 19 | 5 | my ($self, $text, $args, $config) = @_; | |||||||||||
| 20 | 5 | ▶ | die "pipe name?\n" unless defined $args->[0]; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 5 | my $pipe = Text::Pipe->new($args->[0], %$config); | |||||||||||
| 22 | 5 | $pipe->filter($text); | |||||||||||
| 23 | } | ||||||||||||
| 24 | 2 | 1; | |||||||||||
| 25 | |||||||||||||
| 26 | |||||||||||||
| 27 | __END__ | ||||||||||||