26 |
|
my $objectname=shift; |
27 |
|
my $groupchecker=shift; |
28 |
|
|
29 |
< |
my $self = {}; |
29 |
> |
$self = {}; |
30 |
|
$self->{allw}=$objectname; |
31 |
|
bless $self, $class; |
32 |
|
$self->_initialise($file); |
65 |
|
sub parse { |
66 |
|
my $self=shift; |
67 |
|
my $char; |
68 |
+ |
my $buf; |
69 |
|
$self->{linecount}=0; |
70 |
|
$self->_resetvars(); |
71 |
|
|
72 |
|
# Open the file |
73 |
|
use FileHandle; |
74 |
< |
my $filehandle=FileHandle->new(); |
75 |
< |
open( $filehandle , "$self->{filename}" ) |
74 |
> |
my $filehandle; |
75 |
> |
$filehandle=FileHandle->new(); |
76 |
> |
$filehandle->open("<$self->{filename}") |
77 |
|
or return 1; |
78 |
< |
# or carp "Switcher: Cannot open $self->{filename} $! \n"; |
78 |
> |
# The buffering seems all messed up - best not to use it |
79 |
> |
$filehandle->setvbuf($buf, _IONBF, 300); |
80 |
|
|
78 |
– |
print "Starting Parse $self->{filename}\n"; |
81 |
|
# Start file processing |
82 |
< |
while ( <$filehandle> ) { |
82 |
> |
while ( ($_=<$filehandle>) ) { |
83 |
|
$self->{linecount}++; |
84 |
|
$self->{currentline}=$_; |
85 |
+ |
if ( $self->{linecount} > 5 ) { |
86 |
+ |
$DB::single=1; |
87 |
+ |
} |
88 |
|
$self->{stringpos}=0; |
89 |
|
while ( ($char=$self->_nextchar()) ne "" ) { |
90 |
|
$self->_checkchar($char); |
91 |
|
} # end char while |
92 |
|
} # End String while loop |
93 |
|
close $filehandle; |
94 |
< |
print "Exiting Parse $self->{filename}\n"; |
94 |
> |
1; |
95 |
|
} |
96 |
|
|
97 |
|
sub checkparam($name, $key) { |