lhoward has asked for the wisdom of the Perl Monks concerning the following question:
Is there anyway to set the buffer size? Or to force XML::Parser to process its buffer? Might one of the other XML parsers on CPAN serve me better for the task at hand? Any ideas on how to avoid the unwanted buffering? Luse strict; use XML::Parser; use IO::Socket::INET; my $sock=IO::Socket::INET->new( PeerAddr => '127.0.0.1', PeerPort => 6537); my $parser=XML::Parser->new( Style => 'Stream', Handlers => { Start => \&handle_elem_start } ); $parser->parse($sock); sub handle_elem_start{ my ($expat,$name,&atts)=@_; print "in element \"$name\", at byte ".$expat->current_byte()." in s +tream\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::Parser Streams performing undesired buffering
by Thelonius (Priest) on Jun 19, 2003 at 21:37 UTC | |
by lhoward (Vicar) on Jun 20, 2003 at 14:06 UTC | |
Re: XML::Parser Streams performing undesired buffering
by BrowserUk (Patriarch) on Jun 19, 2003 at 19:43 UTC | |
Re: XML::Parser Streams performing undesired buffering
by bobn (Chaplain) on Jun 19, 2003 at 19:21 UTC |