| 1 | package IO::Tokenized::File; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use base qw(IO::Tokenized IO::File); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | $VERSION = '0.05'; | |||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | # new has the following synopsis: | ||||||||||
| 12 | # IO::Tokenized::File->new([$tokens [,$filename]]) | ||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 15 | 1 | my $class = shift; | |||||||||
| 16 | 1 | my ($filename,@tokens) = @_; | |||||||||
| 17 | 1 | ▶ | my $self = defined $filename ? IO::File->new($filename): IO::File->new(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 1 | $self = IO::Tokenized->new($self,@tokens); | |||||||||
| 19 | 1 | bless $self,$class; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | # redefine so that only opening for input is allowed | ||||||||||
| 23 | 0 | ▶ | sub open { | ||||||||
|
Subroutine
open: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 24 | 0 | my $self = shift; | |||||||||
| 25 | 0 | my ($filename) = @_; #silently ignore other parameters | |||||||||
| 26 | 0 | $self->SUPER::open($filename,"r"); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 2 | 1; | |||||||||
| 30 | |||||||||||
| 31 | __END__ | ||||||||||