| 1 | # This original Filter::Util::Call-based | ||||||||||||||||||||||||||||
| 2 | # PDL::NiceSlice engine. | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | 120 | ▶ | use Filter::Util::Call; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | ############################## | ||||||||||||||||||||||||||||
| 7 | # If you mess with the import filter, please also change the pdlpp importer | ||||||||||||||||||||||||||||
| 8 | # just above this comment! They both do similar things, but one to an eval string | ||||||||||||||||||||||||||||
| 9 | # and one to an import file. | ||||||||||||||||||||||||||||
| 10 | # --CED 5-Nov-2007 | ||||||||||||||||||||||||||||
| 11 | # | ||||||||||||||||||||||||||||
| 12 | sub import { | ||||||||||||||||||||||||||||
| 13 | 126 | ▶ | my ($class) = @_; | ||||||||||||||||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 126 | ($file,$offset) = (caller)[1,2]; # for error reporting | |||||||||||||||||||||||||||
| 15 | 126 | $offset++; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | ## Parse class name into a regexp suitable for filtration | ||||||||||||||||||||||||||||
| 18 | 126 | my $terminator = terminator_regexp($class); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | filter_add( | ||||||||||||||||||||||||||||
| 21 | sub { | ||||||||||||||||||||||||||||
| 22 | 250 | ▶ | my ($status, $off, $end); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=9 SCAR=22.6
| |||||||||||||||||||||||||||||
| 23 | 250 | my $count = 0; | |||||||||||||||||||||||||||
| 24 | 250 | my $data = ""; | |||||||||||||||||||||||||||
| 25 | 250 | ▶ | while ($status = filter_read()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 152041 | ▶ | return $status if $status < 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 152041 | ▶ | if (defined($terminator) && m/$terminator/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $terminator and /$terminator/
MC/DC0%0/2
defined $terminator and /$terminator/
defined $terminator
/$terminator/
Truth table33%1/3
A and B
A= defined $terminatorB= /$terminator/
| |||||||||||||||||||||||||||||
| 29 | 0 | $off=1; | |||||||||||||||||||||||||||
| 30 | 0 | last; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 152041 | ▶ | if (m/^\s*(__END__|__DATA__)\s*$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 33 | 2 | $end=$1; $off = 1; | |||||||||||||||||||||||||||
| 34 | 2 | last; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | 152039 | $data .= $_; | |||||||||||||||||||||||||||
| 37 | 152039 | $count++; | |||||||||||||||||||||||||||
| 38 | 152039 | $_ = ""; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | 250 | $_ = $data; | |||||||||||||||||||||||||||
| 41 | 250 | ▶ | $_ = findslice $_ unless $status < 0; # the actual filter | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 250 | ▶ | $_ .= "no $class;\n" if $off; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 250 | ▶ | $_ .= "$end\n" if $end; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | 250 | return $count; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | 126 | ); | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | sub unimport { | ||||||||||||||||||||||||||||
| 50 | 1 | ▶ | filter_del(); | ||||||||||||||||||||||||||
|
Subroutine
unimport: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 120 | 1; | |||||||||||||||||||||||||||