line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Parse::PEM::Lax;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
26220
|
use 5.010000;
|
|
2
|
|
|
|
|
4
|
|
4
|
2
|
|
|
2
|
|
6
|
use strict;
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
28
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
40
|
|
6
|
2
|
|
|
2
|
|
6
|
use base qw(Exporter);
|
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
623
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.01';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw(
|
11
|
|
|
|
|
|
|
) ] );
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw(
|
16
|
|
|
|
|
|
|
);
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub from_string {
|
19
|
3
|
|
|
3
|
1
|
888
|
my ($class, $data) = @_;
|
20
|
3
|
|
|
|
|
10
|
my $self = bless { sections => [] }, $class;
|
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
8
|
my $pem_section = qr#(
|
23
|
|
|
|
|
|
|
(-{5}BEGIN\s+([^\n]*?)-{5})
|
24
|
|
|
|
|
|
|
([^-]*)
|
25
|
|
|
|
|
|
|
(-{5}END\s+([^\n]*?)-{5})
|
26
|
|
|
|
|
|
|
)#x;
|
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
23
|
while ($data =~ /$pem_section/g) {
|
29
|
4
|
|
|
|
|
17
|
my ($block, $head, $label1, $body, $tail, $label2) =
|
30
|
|
|
|
|
|
|
($1, $2, $3, $4, $5, $6);
|
31
|
4
|
|
|
|
|
10
|
$body =~ s/\s+//g;
|
32
|
4
|
|
|
|
|
20
|
$body =~ s/(.{0,76})/$1\n/g;
|
33
|
4
|
|
|
|
|
9
|
$body =~ s/\s+$//;
|
34
|
4
|
|
|
|
|
3
|
push @{ $self->{sections} },
|
|
4
|
|
|
|
|
31
|
|
35
|
|
|
|
|
|
|
sprintf "%s\n%s\n%s\n", $head, $body, $tail;
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
10
|
return $self;
|
39
|
|
|
|
|
|
|
}
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub extract_sections {
|
42
|
3
|
|
|
3
|
1
|
6
|
my ($self) = @_;
|
43
|
3
|
|
|
|
|
1
|
return @{ $self->{sections} };
|
|
3
|
|
|
|
|
9
|
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1;
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__
|