| 1 | package Template::Plugin::RSSLite; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use 5.006; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use base qw( Template::Plugin ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use Template::Plugin; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use XML::RSSLite; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 1 | our $VERSION = '0.03'; | |||||||||||
| 11 | |||||||||||||
| 12 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=4 SCAR=14.1
Pod
documented
| |||||||||||||
| 13 | 1 | my $class = shift; | |||||||||||
| 14 | 1 | my $context = shift; | |||||||||||
| 15 | 1 | ▶ | my $file = shift || return $class->error("Line ".__LINE__." Usage error, see documenatation for usage information."); | ||||||||||
|
Condition50%1/2
shift() || (return $class->error('Line 15 Usage error, see documenatation for usage information.'))
MC/DC0%0/1
shift() || (return $class->error('Line 15 Usage error, see documenatation for usage information.'))
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 16 | 1 | my $result = {}; | |||||||||||
| 17 | 1 | ▶ | open F, $file or return $class->error("Line ".__LINE__." ".$!); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 18 | 1 | my $data = join("",(<F>)); | |||||||||||
| 19 | 1 | close F; | |||||||||||
| 20 | 1 | XML::RSSLite::parseXML($result,\$data); | |||||||||||
| 21 | # use Data::Dumper;print Dumper $result; | ||||||||||||
| 22 | 1 | ▶ | return $class->error("Line ".__LINE__." ".$!) unless ($result->{'rdf:RDF'}{'channel'}{'title'}); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 1 | bless $result, $class; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 1 | 1; | |||||||||||
| 27 | __END__ | ||||||||||||