moved tests in own directory, added test to demonstrate XML::Simple feature
[webpac] / tests / test_xml_simple.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use XML::Simple;
5 use IO::File;
6 use Data::Dumper;
7
8 my $xml = '<?xml version="1.0" encoding="ISO-8859-2"?><xml foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truæ</xml>';
9
10 my $xml_file = shift @ARGV;
11
12 if ($xml_file) {
13         my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!";
14         $xml = XMLin($fh);
15 } else {
16         $xml = XMLin($xml);
17 }
18
19 print Dumper($xml),"\n";
20