MeGa/Item/Text.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 24 CC 1 SCAR 6.9
CC
1
Cov
0%
data
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # $Id: Text.pm 193 2009-01-16 13:42:25Z fish $
2 package WWW::MeGa::Item::Text;
3 use strict;
4 use warnings;
5  
6 =head1 NAME
7  
8 WWW::MeGa::Item::Text - Representing a text file in L<WWW::MeGa>
9  
10 =head1 DESCRIPTION
11  
12 See L<WWW::MeGa::Item>
13  
14 =head1 CHANGED METHODS
15  
16 =cut
17  
18 use base 'WWW::MeGa::Item';
19  
20 our $VERSION = '0.11';
21  
22  
23 =head1 data
24  
25 gets the common data from C<SUPER::data>, puts the text file
26 content in C<$data->{CONTENT}> and return the data.
27  
28 =cut
29  
30 sub data
31 {
32 my $self = shift;
33 my $data = $self->SUPER::data;
34  
35 open my $fh, '<', $self->{path} or die $!;
36 $data->{CONTENT} = <$fh>;
37 close $fh;
38 return $data;
39 }
40  
41 1;