| 1 | package XML::FeedWriter; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 2 | our $VERSION = '0.06'; | |||||||||||
| 8 | |||||||||||||
| 9 | 2 | my %supported = ( | |||||||||||
| 10 | 'RSS20' => 'RSS20', | ||||||||||||
| 11 | 'RSS 2.0' => 'RSS20', | ||||||||||||
| 12 | '2.0' => 'RSS20', | ||||||||||||
| 13 | 2 => 'RSS20', # in case version specified as a number | ||||||||||||
| 14 | ); | ||||||||||||
| 15 | |||||||||||||
| 16 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 17 | 0 | my ($class, %options) = @_; | |||||||||||
| 18 | |||||||||||||
| 19 | 0 | ▶ | my $version = delete $options{version} || '2.0'; | ||||||||||
|
Condition0%0/2
delete $options{'version'} || '2.0'
MC/DC0%0/1
delete $options{'version'} || '2.0'
delete $options{'version'}
Truth table0%0/2
A
A= delete $options{'version'}
| |||||||||||||
| 20 | |||||||||||||
| 21 | 0 | ▶ | croak "not yet supported: $version" unless $supported{$version}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | |||||||||||||
| 23 | 0 | my $package = __PACKAGE__.'::'.$supported{$version}; | |||||||||||
| 24 | 0 | ▶ | eval "require $package;" or die $@; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | |||||||||||||
| 26 | 0 | $package->new(%options); | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 2 | 1; | |||||||||||
| 30 | |||||||||||||
| 31 | __END__ | ||||||||||||