| 1 | package Acme::OnePiece; | ||||||||||
| 2 | 1 | ▶ | use 5.008005; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use IO::File; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | our $VERSION = "0.02"; | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub _options { | ||||||||
|
Subroutine
_options: not called CC=1 SCAR=6.9
| |||||||||||
| 11 | return {} | ||||||||||
| 12 | 0 | } | |||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 15 | 0 | my $class = shift; | |||||||||
| 16 | 0 | my $file = shift; | |||||||||
| 17 | 0 | my $options = $class->_options; | |||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | my $io = IO::File->new($file, 'r') or die "Usage: Acme::OnePiece->new(\$filename)\n" . $!; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | my @lines = $io->getlines; | |||||||||
| 21 | 0 | my $contents = join('',@lines); | |||||||||
| 22 | 0 | $options->{contents} = $contents; | |||||||||
| 23 | |||||||||||
| 24 | 0 | my $self = bless $options, $class; | |||||||||
| 25 | 0 | return $self; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub onepiece { | ||||||||
|
Subroutine
onepiece: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | my ($self) = @_; | |||||||||
| 30 | 0 | my $contents = $self->{contents}; | |||||||||
| 31 | 0 | $contents =~ s/(\n+|\s+)/-/g; | |||||||||
| 32 | 0 | $contents =~ s/-+/-/g; | |||||||||
| 33 | 0 | return $contents; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 1 | 1; | |||||||||
| 37 | __END__ | ||||||||||