Subject: | Error on simple test? |
Your POD refers to non-existant methods - initialize_parser is in you8r code initialize_parsing, I guess. If you call the below toy code, cased on your POD, you'll get an error because it's not possible to setparser before you initialize_parsing.
A shame, because this looks like it could be a great and very useful module.
__PERL__
use strict;
use IO::Tokenized;
open OUT,">io_test.txt" or die "Can't write out $!";
print OUT <<__ENOUGH__;
this is all site this is all site this is all site
this is all site this is __THE_TOKEN__ this is all site
this is all site this is all site this is all site
__ENOUGH__
close OUT;
my $marker = "__THE_TOKEN__";
open FOO,"<","io_test.txt" or die "Can't open input file $!";
&IO::Tokenized::setparser(\*FOO,
[num => qr/\d+/],
# [marker => qr!$marker!,\&work]
);
while (my ($tok,$val) = IO::Tokenized::gettoken(\*FOO)) {
#... do something dumb:
warn "$tok -- $val";
}
close(FOO);
sub work {
warn "*********** WORKING ***************";
}
__END__