File Coverage

blib/lib/IO/Tokenized/File.pm
Criterion Covered Total %
statement 17 20 85.0
branch 1 2 50.0
condition n/a
subroutine 5 6 83.3
pod 2 2 100.0
total 25 30 83.3


line stmt bran cond sub pod time code
1             package IO::Tokenized::File;
2 2     2   111520 use strict;
  2         6  
  2         93  
3 2     2   11 use base qw(IO::Tokenized IO::File);
  2         4  
  2         4814  
4 2     2   38784 use vars qw($VERSION);
  2         4  
  2         96  
5              
6 2     2   23 use Carp;
  2         5  
  2         384  
7              
8             $VERSION = '0.05';
9              
10              
11             # new has the following synopsis:
12             # IO::Tokenized::File->new([$tokens [,$filename]])
13              
14             sub new {
15 1     1 1 959 my $class = shift;
16 1         4 my ($filename,@tokens) = @_;
17 1 50       14 my $self = defined $filename ? IO::File->new($filename): IO::File->new();
18 1         213 $self = IO::Tokenized->new($self,@tokens);
19 1         9 bless $self,$class;
20             }
21              
22             # redefine so that only opening for input is allowed
23             sub open {
24 0     0 1   my $self = shift;
25 0           my ($filename) = @_; #silently ignore other parameters
26 0           $self->SUPER::open($filename,"r");
27             }
28              
29             1;
30              
31             __END__