Subject: | Broken parser? |
Great module but maybe I'm mis-reading, or maybe it is broken: here's what I do:
TESTING: {
my $testing = "";
while ( my ( $token_type, $argument, $parameter ) = $tokenizer->get_token() ){
last if $token_type eq 'eof';
warn sprintf "testing[% 10s] = [% 20s] -> [% 10s]\n", $token_type, $argument, $parameter if $DEBUG;
if ($token_type eq 'group' and $argument==1){
$testing .= "{";
}
elsif ($token_type eq 'group' and $argument==0){
$testing .= "}\n";
}
elsif ($token_type eq 'control'){
$testing .= "\\".$argument.(defined $parameter? $parameter : "");
}
elsif ($token_type eq 'text'){
$testing .= $argument;
}
}
open OUT, ">E:/testing_no_additions.rtf";
print OUT $testing;
close OUT;
}
Now the file that is output is not the same as that which goes in. In fact, the prolog meta info seems to get inserted into the main document. Is there a buffer problem somewhere, or is my use faulty?
The file I'm using as input is attached, since some files (without meta info) seem okay.
Thanks in anticipation,
lee
Message body not shown because it is not plain text.