Bug 2505 - use strict and warnings in sax_parser_test
[koha.git] / misc / sax_parser_test.pl
blobb2e597405c8f74b15e2d9aca65531ede7f8a027f
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 use XML::SAX;
7 use Encode;
9 my $parser = XML::SAX::ParserFactory->parser(
10 Handler => MySAXHandler->new
12 binmode STDOUT, ":utf8";
13 print "\x{65}\x{301}\n";
14 $parser->parse_string(encode_utf8("<xml>\x{65}\x{301}</xml>"));
15 $parser->parse_string("<xml>\xEF\xBB\xBF\x{65}\x{301}</xml>");
17 package MySAXHandler;
19 use base qw(XML::SAX::Base);
20 sub start_document {
21 my ($self, $doc) = @_;
22 # process document start event
25 sub start_element {
26 my ($self, $el) = @_;
27 # process element start event