| 1 | package Project::Easy::Config::Format::perl; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Class::Easy; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | { | ||||||||||
| 8 | 1 | ▶ | no warnings 'redefine'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 0 | ▶ | sub Data::Dumper::qquote { | ||||||||
|
Subroutine
qquote: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 10 | 0 | my $s = shift; | |||||||||
| 11 | 0 | return "'$s'"; | |||||||||
| 12 | } | ||||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 5 | my $class = shift; | |||||||||
| 17 | 5 | bless {}, $class; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 3 | ▶ | sub parse_string { | ||||||||
|
Subroutine
parse_string: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 21 | 3 | shift; | |||||||||
| 22 | 3 | my $string = shift; | |||||||||
| 23 | |||||||||||
| 24 | # TODO: we only need one parser configuration | ||||||||||
| 25 | 3 | my $struct = eval $string; | |||||||||
| 26 | |||||||||||
| 27 | 3 | ▶ | die ('error when parsing config: ', $@) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | if $@; | ||||||||||
| 29 | |||||||||||
| 30 | 3 | return $struct; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 3 | ▶ | sub dump_struct { | ||||||||
|
Subroutine
dump_struct: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 34 | 3 | shift; | |||||||||
| 35 | 3 | my $struct = shift; | |||||||||
| 36 | |||||||||||
| 37 | { | ||||||||||
| 38 | 3 | local $Data::Dumper::Useqq = 1; | |||||||||
| 39 | 3 | my $str = Dumper ($struct); | |||||||||
| 40 | |||||||||||
| 41 | 3 | $str =~ s/^\$VAR\d+\s=\s//s; | |||||||||
| 42 | |||||||||||
| 43 | 3 | return $str; | |||||||||
| 44 | } | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | |||||||||||
| 48 | 1 | 1; | |||||||||