#!/usr/bin/perl -w # $Id: bench_parser_nothing,v 1.3 2003/09/19 18:52:26 mrodrigu Exp $ use strict; use simple_benchmark; # to get memory size use XML::Parser; use Getopt::Long; my( $in_file); GetOptions( 'in_file=s' =>\$in_file); $in_file ||= 'test.xml'; my $p = new XML::Parser( Handlers => { Default => sub { print $_[0]->recognized_string(); }, # we need those as Default is not called for start # and end events: # From XML::Parser::Expat: # the default handler will not see a start tag or # end tag unless the default_current method is called. Start => sub { print $_[0]->recognized_string(); }, End => sub { print $_[0]->recognized_string(); }, } ); $p->parsefile( $in_file);