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