Hello community,

here is the log from the commit of package perl-XML-Simple for openSUSE:Factory 
checked in at 2015-12-13 09:36:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-XML-Simple (Old)
 and      /work/SRC/openSUSE:Factory/.perl-XML-Simple.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-XML-Simple"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-XML-Simple/perl-XML-Simple.changes  
2014-06-30 21:50:27.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-XML-Simple.new/perl-XML-Simple.changes     
2015-12-13 09:36:43.000000000 +0100
@@ -1,0 +2,31 @@
+Sat Dec  5 10:48:07 UTC 2015 - [email protected]
+
+- updated to 2.22
+   see /usr/share/doc/packages/perl-XML-Simple/Changes
+
+  2.22      2015-12-05 11:08:20+13:00 Pacific/Auckland
+    - POD fix in link to package XML::SAX::ParseFactory (from Mohammad S Anwar)
+    - allow subclass to override attribute escaping (from Christopher Masto)
+    - POD fix adding NAME section to FAQ (RT#110080 from Bart Martens & gregor
+      herrmann of the Debian project)
+    - POD typo fix (RT#110082 from gregor herrmann of the Debian project)
+    - fix reference comparison operator used in checking for circular data
+      structures (RT#89553 from Laurent Dami)
+    - add better diagnostics from file handling code in test suite
+  
+  2.21      2015-12-04 16:33:49+13:00 Pacific/Auckland
+    - Improved diagnostics - xml_in() will now catch parse exceptions and add
+      caller information via Carp::croak
+    - Switch to use lexical warnings (suppress with either 'no warnings;' or
+      'no warnings "XML::Simple";', rather than $^W = 0)
+    - POD fixes (from David Steinbrunner)
+    - Regex escaping fixes for Perl 5.22+ (from Kent Fredric)
+    - Add workaround for test failures on RHEL/CentOS 6.5 (RT#102115 from
+      Chris Drake, workaround from Tim Bunce)
+    - Remove some 'eval' calls from test suite which could mask root cause of
+      test failures
+    - Make each test script use unique filenames to allow tests to be run in
+      parallel (RT#101362 from Karen Etheridge & Kent Fredric)
+    - POD update: mention XML::Twig in 'STATUS' section (RT#79228 from Matt 
Trout)
+
+-------------------------------------------------------------------

Old:
----
  XML-Simple-2.20.tar.gz

New:
----
  XML-Simple-2.22.tar.gz
  cpanspec.yml

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-XML-Simple.spec ++++++
--- /var/tmp/diff_new_pack.hcm09U/_old  2015-12-13 09:36:44.000000000 +0100
+++ /var/tmp/diff_new_pack.hcm09U/_new  2015-12-13 09:36:44.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-XML-Simple
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,15 @@
 
 
 Name:           perl-XML-Simple
-Version:        2.20
+Version:        2.22
 Release:        0
 %define cpan_name XML-Simple
-Summary:        Easily read/write XML (esp config files)
+Summary:        An API for simple XML files
 License:        Artistic-1.0 or GPL-1.0+
 Group:          Development/Libraries/Perl
 Url:            http://search.cpan.org/dist/XML-Simple/
-Source:         
http://www.cpan.org/authors/id/G/GR/GRANTM/%{cpan_name}-%{version}.tar.gz
+Source0:        
http://www.cpan.org/authors/id/G/GR/GRANTM/%{cpan_name}-%{version}.tar.gz
+Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
@@ -42,13 +43,13 @@
 The XML::Simple module provides a simple API layer on top of an underlying
 XML parsing module (either XML::Parser or one of the SAX2 parser modules).
 Two functions are exported: 'XMLin()' and 'XMLout()'. Note: you can
-explicity request the lower case versions of the function names: 'xml_in()'
-and 'xml_out()'.
+explicitly request the lower case versions of the function names:
+'xml_in()' and 'xml_out()'.
 
 The simplest approach is to call these two functions directly, but an
-optional object oriented interface (see the "OPTIONAL OO INTERFACE" manpage
-below) allows them to be called as methods of an *XML::Simple* object. The
-object interface can also be used at either end of a SAX pipeline.
+optional object oriented interface (see "OPTIONAL OO INTERFACE" below)
+allows them to be called as methods of an *XML::Simple* object. The object
+interface can also be used at either end of a SAX pipeline.
 
 %prep
 %setup -q -n %{cpan_name}-%{version}

++++++ XML-Simple-2.20.tar.gz -> XML-Simple-2.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/Changes new/XML-Simple-2.22/Changes
--- old/XML-Simple-2.20/Changes 2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/Changes 2015-12-04 23:08:23.000000000 +0100
@@ -1,5 +1,30 @@
 Revision history for XML-Simple
 
+2.22      2015-12-05 11:08:20+13:00 Pacific/Auckland
+  - POD fix in link to package XML::SAX::ParseFactory (from Mohammad S Anwar)
+  - allow subclass to override attribute escaping (from Christopher Masto)
+  - POD fix adding NAME section to FAQ (RT#110080 from Bart Martens & gregor
+    herrmann of the Debian project)
+  - POD typo fix (RT#110082 from gregor herrmann of the Debian project)
+  - fix reference comparison operator used in checking for circular data
+    structures (RT#89553 from Laurent Dami)
+  - add better diagnostics from file handling code in test suite
+
+2.21      2015-12-04 16:33:49+13:00 Pacific/Auckland
+  - Improved diagnostics - xml_in() will now catch parse exceptions and add
+    caller information via Carp::croak
+  - Switch to use lexical warnings (suppress with either 'no warnings;' or
+    'no warnings "XML::Simple";', rather than $^W = 0)
+  - POD fixes (from David Steinbrunner)
+  - Regex escaping fixes for Perl 5.22+ (from Kent Fredric)
+  - Add workaround for test failures on RHEL/CentOS 6.5 (RT#102115 from
+    Chris Drake, workaround from Tim Bunce)
+  - Remove some 'eval' calls from test suite which could mask root cause of
+    test failures
+  - Make each test script use unique filenames to allow tests to be run in
+    parallel (RT#101362 from Karen Etheridge & Kent Fredric)
+  - POD update: mention XML::Twig in 'STATUS' section (RT#79228 from Matt 
Trout)
+
 2.20      2012-06-20 22:00:13 Pacific/Auckland
   - Suppress warning from empty CDATA section (RT#58359 from Juan Antonio
     Navarro Pérez)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/LICENSE new/XML-Simple-2.22/LICENSE
--- old/XML-Simple-2.20/LICENSE 2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/LICENSE 2015-12-04 23:08:23.000000000 +0100
@@ -1,4 +1,4 @@
-This software is copyright (c) 2012 by Grant McLean.
+This software is copyright (c) 2015 by Grant McLean.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,21 +12,22 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2012 by Grant McLean.
+This software is Copyright (c) 2015 by Grant McLean.
 
 This is free software, licensed under:
 
   The GNU General Public License, Version 1, February 1989
 
-                   GNU GENERAL PUBLIC LICENSE
-                    Version 1, February 1989
+                    GNU GENERAL PUBLIC LICENSE
+                     Version 1, February 1989
 
  Copyright (C) 1989 Free Software Foundation, Inc.
-                59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ 51 Franklin St, Suite 500, Boston, MA  02110-1335  USA
+
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                           Preamble
+                            Preamble
 
   The license agreements of most software companies try to keep users
 at the mercy of those companies.  By contrast, our General Public
@@ -67,7 +68,7 @@
   The precise terms and conditions for copying, distribution and
 modification follow.
 
-                   GNU GENERAL PUBLIC LICENSE
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License Agreement applies to any program or other work which
@@ -185,7 +186,7 @@
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-                           NO WARRANTY
+                            NO WARRANTY
 
   9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -207,9 +208,9 @@
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-                    END OF TERMS AND CONDITIONS
+                     END OF TERMS AND CONDITIONS
 
-       Appendix: How to Apply These Terms to Your New Programs
+        Appendix: How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to humanity, the best way to achieve this is to make it
@@ -235,8 +236,9 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software Foundation,
-    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 
USA
+
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -270,7 +272,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2012 by Grant McLean.
+This software is Copyright (c) 2015 by Grant McLean.
 
 This is free software, licensed under:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/MANIFEST new/XML-Simple-2.22/MANIFEST
--- old/XML-Simple-2.20/MANIFEST        2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/MANIFEST        2015-12-04 23:08:23.000000000 +0100
@@ -1,3 +1,4 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v5.022.
 Changes
 LICENSE
 MANIFEST
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/META.json 
new/XML-Simple-2.22/META.json
--- old/XML-Simple-2.20/META.json       2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/META.json       2015-12-04 23:08:23.000000000 +0100
@@ -1,10 +1,10 @@
 {
-   "abstract" : "Easily read/write XML (esp config files)",
+   "abstract" : "An API for simple XML files",
    "author" : [
       "Grant McLean <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 4.200004, CPAN::Meta::Converter 
version 2.101670",
+   "generated_by" : "Dist::Zilla version 5.022, CPAN::Meta::Converter version 
2.142690",
    "license" : [
       "perl_5"
    ],
@@ -16,14 +16,19 @@
    "prereqs" : {
       "configure" : {
          "requires" : {
-            "ExtUtils::MakeMaker" : "6.31"
+            "ExtUtils::MakeMaker" : "0"
+         }
+      },
+      "develop" : {
+         "requires" : {
+            "Test::Pod" : "1.41"
          }
       },
       "runtime" : {
          "requires" : {
             "XML::NamespaceSupport" : "1.04",
             "XML::SAX" : "0.15",
-            "XML::SAX::Expat" : 0,
+            "XML::SAX::Expat" : "0",
             "perl" : "5.008"
          }
       },
@@ -38,9 +43,9 @@
       "repository" : {
          "type" : "git",
          "url" : "git://github.com/grantm/xml-simple.git",
-         "web" : "http://github.com/grantm/xml-simple";
+         "web" : "https://github.com/grantm/xml-simple";
       }
    },
-   "version" : "2.20"
+   "version" : "2.22"
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/META.yml new/XML-Simple-2.22/META.yml
--- old/XML-Simple-2.20/META.yml        2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/META.yml        2015-12-04 23:08:23.000000000 +0100
@@ -1,13 +1,13 @@
 ---
-abstract: 'Easily read/write XML (esp config files)'
+abstract: 'An API for simple XML files'
 author:
   - 'Grant McLean <[email protected]>'
 build_requires:
   Test::More: 0.88
 configure_requires:
-  ExtUtils::MakeMaker: 6.31
+  ExtUtils::MakeMaker: 0
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 
2.101670'
+generated_by: 'Dist::Zilla version 5.022, CPAN::Meta::Converter version 
2.142690'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -20,4 +20,4 @@
   perl: 5.008
 resources:
   repository: git://github.com/grantm/xml-simple.git
-version: 2.20
+version: 2.22
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/Makefile.PL 
new/XML-Simple-2.22/Makefile.PL
--- old/XML-Simple-2.20/Makefile.PL     2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/Makefile.PL     2015-12-04 23:08:23.000000000 +0100
@@ -1,49 +1,53 @@
 
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v5.022.
 use strict;
 use warnings;
 
-BEGIN { require 5.008; }
+use 5.008;
 
-use ExtUtils::MakeMaker 6.31;
+use ExtUtils::MakeMaker;
 
 
 
 my %WriteMakefileArgs = (
-  'ABSTRACT' => 'Easily read/write XML (esp config files)',
-  'AUTHOR' => 'Grant McLean <[email protected]>',
-  'BUILD_REQUIRES' => {
-    'Test::More' => '0.88'
+  "ABSTRACT" => "An API for simple XML files",
+  "AUTHOR" => "Grant McLean <grantm\@cpan.org>",
+  "CONFIGURE_REQUIRES" => {
+    "ExtUtils::MakeMaker" => 0
   },
-  'CONFIGURE_REQUIRES' => {
-    'ExtUtils::MakeMaker' => '6.31'
+  "DISTNAME" => "XML-Simple",
+  "EXE_FILES" => [],
+  "LICENSE" => "perl",
+  "MIN_PERL_VERSION" => "5.008",
+  "NAME" => "XML::Simple",
+  "PREREQ_PM" => {
+    "XML::NamespaceSupport" => "1.04",
+    "XML::SAX" => "0.15",
+    "XML::SAX::Expat" => 0
   },
-  'DISTNAME' => 'XML-Simple',
-  'EXE_FILES' => [],
-  'LICENSE' => 'perl',
-  'NAME' => 'XML::Simple',
-  'PREREQ_PM' => {
-    'XML::NamespaceSupport' => '1.04',
-    'XML::SAX' => '0.15',
-    'XML::SAX::Expat' => '0'
+  "TEST_REQUIRES" => {
+    "Test::More" => "0.88"
   },
-  'VERSION' => '2.20',
-  'test' => {
-    'TESTS' => 't/*.t'
+  "VERSION" => "2.22",
+  "test" => {
+    "TESTS" => "t/*.t"
   }
 );
 
 
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
-  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
-  my $pp = $WriteMakefileArgs{PREREQ_PM};
-  for my $mod ( keys %$br ) {
-    if ( exists $pp->{$mod} ) {
-      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
-    }
-    else {
-      $pp->{$mod} = $br->{$mod};
-    }
-  }
+my %FallbackPrereqs = (
+  "ExtUtils::MakeMaker" => 0,
+  "Test::More" => "0.88",
+  "XML::NamespaceSupport" => "1.04",
+  "XML::SAX" => "0.15",
+  "XML::SAX::Expat" => 0
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+  delete $WriteMakefileArgs{TEST_REQUIRES};
+  delete $WriteMakefileArgs{BUILD_REQUIRES};
+  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
 }
 
 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/README new/XML-Simple-2.22/README
--- old/XML-Simple-2.20/README  2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/README  2015-12-04 23:08:23.000000000 +0100
@@ -1,13 +1,15 @@
 
 
 This archive contains the distribution XML-Simple,
-version 2.20:
+version 2.22:
 
-  Easily read/write XML (esp config files)
+  An API for simple XML files
 
-This software is copyright (c) 2012 by Grant McLean.
+This software is copyright (c) 2015 by Grant McLean.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
 
 
+This README file was generated by Dist::Zilla::Plugin::Readme v5.022.
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/dist.ini new/XML-Simple-2.22/dist.ini
--- old/XML-Simple-2.20/dist.ini        2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/dist.ini        2015-12-04 23:08:23.000000000 +0100
@@ -1,9 +1,9 @@
 name             = XML-Simple
 author           = Grant McLean <[email protected]>
-version          = 2.20
+version          = 2.22
 license          = Perl_5
 copyright_holder = Grant McLean
-copyright_year   = 2012
+copyright_year   = 2015
 main_module      = lib/XML/Simple.pm
 repository       = git://github.com/grantm/xml-simple.git
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/lib/XML/Simple/FAQ.pod 
new/XML-Simple-2.22/lib/XML/Simple/FAQ.pod
--- old/XML-Simple-2.20/lib/XML/Simple/FAQ.pod  2012-06-20 12:00:21.000000000 
+0200
+++ new/XML-Simple-2.22/lib/XML/Simple/FAQ.pod  2015-12-04 23:08:23.000000000 
+0100
@@ -1,10 +1,7 @@
-package XML::Simple::FAQ;
-1;
 
-__END__
-
-=head1 Frequently Asked Questions about XML::Simple
+=head1 NAME
 
+XML::Simple::FAQ - Frequently Asked Questions about XML::Simple
 
 =head1 Basics
 
@@ -170,7 +167,7 @@
 
 Is the directory where you've unpacked XML::Simple mounted from a file server
 using NFS, SMB or some other network file sharing?  If so, that may cause
-errors in the the following test scripts:
+errors in the following test scripts:
 
   3_Storable.t
   4_MemShare.t
@@ -200,7 +197,7 @@
 
 Is one of the three test scripts (above) failing but you're not running on
 a network filesystem?  Are you running Win32?  If so, you may be seeing a bug
-in Win32 where writes to a file do not affect its modfication timestamp.
+in Win32 where writes to a file do not affect its modification timestamp.
 
 If none of these scenarios match your situation, please confirm you're
 running the latest version of XML::Simple and then email the output of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/lib/XML/Simple.pm 
new/XML-Simple-2.22/lib/XML/Simple.pm
--- old/XML-Simple-2.20/lib/XML/Simple.pm       2012-06-20 12:00:21.000000000 
+0200
+++ new/XML-Simple-2.22/lib/XML/Simple.pm       2015-12-04 23:08:23.000000000 
+0100
@@ -1,14 +1,14 @@
 package XML::Simple;
-BEGIN {
-  $XML::Simple::VERSION = '2.20';
-}
-
+$XML::Simple::VERSION = '2.22';
 =head1 NAME
 
-XML::Simple - Easily read/write XML (esp config files)
+XML::Simple - An API for simple XML files
 
 =head1 SYNOPSIS
 
+You really don't want to use this module in new code.  If you ignore this
+warning and use it anyway, the C<qw(:strict)> mode will save you a little pain.
+
     use XML::Simple qw(:strict);
 
     my $ref = XMLin([<xml file or string>] [, <options>]);
@@ -38,7 +38,10 @@
 # Load essentials here, other modules loaded on demand later
 
 use strict;
+use warnings;
+use warnings::register;
 use Carp;
+use Scalar::Util qw();
 require Exporter;
 
 
@@ -326,7 +329,10 @@
 sub build_simple_tree {
   my $self = shift;
 
-  my $tree = $self->build_tree(@_);
+  my $tree = eval {
+    $self->build_tree(@_);
+  };
+  Carp::croak("$@XML::Simple called") if $@;
 
   return $self->{opt}->{keeproot}
          ? $self->collapse({}, @$tree)
@@ -635,7 +641,7 @@
 
   # Encode the hashref and write to file if necessary
 
-  $self->{_ancestors} = [];
+  $self->{_ancestors} = {};
   my $xml = $self->value_to_xml($ref, $self->{opt}->{rootname}, '');
   delete $self->{_ancestors};
 
@@ -787,7 +793,7 @@
   }
 
   if(exists($opt->{parseropts})) {
-    if($^W) {
+    if(warnings::enabled()) {
       carp "Warning: " .
            "'ParserOpts' is deprecated, contact the author if you need it";
     }
@@ -1010,7 +1016,7 @@
 
   if(my $var = $self->{_var_values}) {
     while(my($key, $val) = each(%$attr)) {
-      $val =~ s{\$\{([\w.]+)\}}{ $self->get_var($1) }ge;
+      $val =~ s^\$\{([\w.]+)\}^ $self->get_var($1) ^ge;
       $attr->{$key} = $val;
     }
   }
@@ -1047,7 +1053,7 @@
       # do variable substitutions
 
       if(my $var = $self->{_var_values}) {
-        $val =~ s{\$\{(\w+)\}}{ $self->get_var($1) }ge;
+        $val =~ s^\$\{(\w+)\}^ $self->get_var($1) ^ge;
       }
 
 
@@ -1321,15 +1327,15 @@
 # 3. ignores message and returns silently if neither strict mode nor warnings
 #    are enabled
 #
-# Option 2 looks at the global warnings variable $^W - which is not really
-# appropriate in the modern world of lexical warnings - TODO: Fix
 
 sub die_or_warn {
   my $self = shift;
   my $msg  = shift;
 
   croak $msg if($self->{opt}->{strictmode});
-  carp "Warning: $msg" if($^W);
+  if(warnings::enabled()) {
+    carp "Warning: $msg";
+  }
 }
 
 
@@ -1354,7 +1360,7 @@
 #
 # Arguments expected are:
 # - an XML::Simple object
-# - a hasref
+# - a hashref
 # the hashref is a former array, turned into a hash by array_to_hash because
 # of the presence of key attributes
 # at this point collapse_content avoids over-complicated structures like
@@ -1422,10 +1428,10 @@
 
   # Convert to XML
 
-  if(ref($ref)) {
+  if(my $refaddr = Scalar::Util::refaddr($ref)) {
     croak "circular data structures not supported"
-      if(grep($_ == $ref, @{$self->{_ancestors}}));
-    push @{$self->{_ancestors}}, $ref;
+      if $self->{_ancestors}->{$refaddr};
+    $self->{_ancestors}->{$refaddr} = 1;
   }
   else {
     if($named) {
@@ -1547,7 +1553,7 @@
           unless(exists($self->{opt}->{suppressempty})
              and !defined($self->{opt}->{suppressempty})
           ) {
-            carp 'Use of uninitialized value' if($^W);
+            carp 'Use of uninitialized value' if warnings::enabled();
           }
           if($key eq $self->{opt}->{contentkey}) {
             $text_content = '';
@@ -1571,11 +1577,12 @@
             $self->value_to_xml($value, $key, "$indent  ");
         }
         else {
-          $value = $self->escape_value($value) 
unless($self->{opt}->{noescape});
           if($key eq $self->{opt}->{contentkey}) {
+            $value = $self->escape_value($value) 
unless($self->{opt}->{noescape});
             $text_content = $value;
           }
           else {
+            $value = $self->escape_attr($value) 
unless($self->{opt}->{noescape});
             push @result, "\n$indent " . ' ' x length($name)
               if($self->{opt}->{attrindent}  and  !$first_arg);
             push @result, ' ', $key, '="', $value , '"';
@@ -1642,7 +1649,9 @@
   }
 
 
-  pop @{$self->{_ancestors}} if(ref($ref));
+  if(my $refaddr = Scalar::Util::refaddr($ref)) {
+    delete $self->{_ancestors}->{$refaddr};
+  }
 
   return(join('', @result));
 }
@@ -1709,8 +1718,6 @@
 sub numeric_escape {
   my($self, $data, $level) = @_;
 
-  use utf8; # required for 5.6
-
   if($self->{opt}->{numericescape} eq '2') {
     $data =~ s/([^\x00-\x7F])/'&#' . ord($1) . ';'/gse;
   }
@@ -1721,6 +1728,19 @@
   return $data;
 }
 
+##############################################################################
+# Method: escape_attr()
+#
+# Helper routine for escaping attribute values.  Defaults to escape_value(),
+# but may be overridden by a subclass to customise behaviour.
+#
+
+sub escape_attr {
+  my $self = shift;
+
+  return $self->escape_value(@_);
+}
+
 
 ##############################################################################
 # Method: hash_to_array()
@@ -1890,10 +1910,12 @@
 
 The use of this module in new code is discouraged.  Other modules are available
 which provide more straightforward and consistent interfaces.  In particular,
-L<XML::LibXML> is highly recommended.
+L<XML::LibXML> is highly recommended and L<XML::Twig> is an excellent
+alternative.
 
-The major problems with this module are the large number of options and the
-arbitrary ways in which these options interact - often with unexpected results.
+The major problems with this module are the large number of options (some of
+which have unfortunate defaults) and the arbitrary ways in which these options
+interact - often producing unexpected results.
 
 Patches with bug fixes and documentation fixes are welcome, but new features
 are unlikely to be added.
@@ -1995,7 +2017,7 @@
 
 The XML::Simple module provides a simple API layer on top of an underlying XML
 parsing module (either XML::Parser or one of the SAX2 parser modules).  Two
-functions are exported: C<XMLin()> and C<XMLout()>.  Note: you can explicity
+functions are exported: C<XMLin()> and C<XMLout()>.  Note: you can explicitly
 request the lower case versions of the function names: C<xml_in()> and
 C<xml_out()>.
 
@@ -2214,7 +2236,7 @@
 
 =head2 ContentKey => 'keyname' I<# in+out - seldom used>
 
-When text content is parsed to a hash value, this option let's you specify a
+When text content is parsed to a hash value, this option lets you specify a
 name for the hash key to override the default 'content'.  So for example:
 
   XMLin('<opt one="1">Text</opt>', ContentKey => 'text')
@@ -2470,7 +2492,7 @@
 
 =head2 KeyAttr => { list } I<# in+out - important>
 
-This alternative (and preferred) method of specifiying the key attributes
+This alternative (and preferred) method of specifying the key attributes
 allows more fine grained control over which elements are folded and on which
 attributes.  For example the option 'KeyAttr => { package => 'id' } will cause
 any package elements to be folded on the 'id' attribute.  No other elements
@@ -2479,7 +2501,8 @@
 Note: C<XMLin()> will generate a warning (or a fatal error in L<"STRICT MODE">)
 if this syntax is used and an element which does not have the specified key
 attribute is encountered (eg: a 'package' element without an 'id' attribute, to
-use the example above).  Warnings will only be generated if B<-w> is in force.
+use the example above).  Warnings can be suppressed with the lexical
+C<no warnings;> pragma or C<no warnings 'XML::Simple';>.
 
 Two further variations are made possible by prefixing a '+' or a '-' character
 to the attribute name:
@@ -2885,6 +2908,12 @@
 Called from C<XMLout()>, takes a string and returns a copy of the string with
 XML character escaping rules applied.
 
+=item escape_attr(string)
+
+Called from C<XMLout()>, to handle attribute values.  By default, just calls
+C<escape_value()>, but you can override this method if you want attributes
+escaped differently than text content.
+
 =item numeric_escape(string)
 
 Called from C<escape_value()>, to handle non-ASCII characters (depending on the
@@ -2944,8 +2973,8 @@
 
 Data error - KeyAttr is set to say { part => 'partnum' } but the XML contains
 one or more E<lt>partE<gt> elements without a 'partnum' attribute (or nested
-element).  Note: if strict mode is not set but -w is, this condition triggers a
-warning.
+element).  Note: if strict mode is not set but C<use warnings;> is in force,
+this condition triggers a warning.
 
 =item *
 
@@ -3089,7 +3118,7 @@
 =item *
 
 If the 'preferred parser' is set to some other value, then it is assumed to be
-the name of a SAX parser module and is passed to L<XML::SAX::ParserFactory.>
+the name of a SAX parser module and is passed to L<XML::SAX::ParserFactory>.
 If L<XML::SAX> is not installed, or the requested parser module is not
 installed, then C<XMLin()> will die.
 
@@ -3233,7 +3262,7 @@
                 ]
     }
 
-Anonymous arrays can be nested to arbirtrary levels and as a special case, if
+Anonymous arrays can be nested to arbitrary levels and as a special case, if
 the surrounding tags for an XML document contain only an anonymous array the
 arrayref will be returned directly rather than the usual hashref:
 
@@ -3299,7 +3328,7 @@
 =back
 
 In a serious XML project, you'll probably outgrow these assumptions fairly
-quickly.  This section of the document used to offer some advice on chosing a
+quickly.  This section of the document used to offer some advice on choosing a
 more powerful option.  That advice has now grown into the 'Perl-XML FAQ'
 document which you can find at: L<http://perl-xml.sourceforge.net/faq/>
 
@@ -3307,7 +3336,7 @@
 event based parsers and then recommends:
 
 For event based parsing, use SAX (do not set out to write any new code for
-XML::Parser's handler API - it is obselete).
+XML::Parser's handler API - it is obsolete).
 
 For tree-based parsing, you could choose between the 'Perlish' approach of
 L<XML::Twig> and more standards based DOM implementations - preferably one with
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/1_XMLin.t 
new/XML-Simple-2.22/t/1_XMLin.t
--- old/XML-Simple-2.20/t/1_XMLin.t     2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/1_XMLin.t     2015-12-04 23:08:23.000000000 +0100
@@ -5,10 +5,7 @@
 use IO::File;
 use File::Spec;
 
-
-# The suppress-able warnings still check the global flag
-
-$^W = 1;
+use XML::Simple;
 
 # Initialise filenames and check they're there
 
@@ -18,13 +15,11 @@
   plan skip_all => 'Test data missing';
 }
 
-plan tests => 131;
+plan tests => 132;
 
 
 my $last_warning = '';
 
-$@ = '';
-eval "use XML::Simple;";
 is($@, '', 'Module compiled OK');
 my $version = 'unknown';
 if(open my $chg, '<Changes') {
@@ -391,13 +386,14 @@
   );
 
   $last_warning = '';
-  local($^W) = 0;
-  $opt = XMLin($xml, keyattr => { item => 'name' }, @cont_key);
-  is_deeply($opt, $target, "did not fold on specific key with non-scalar 
value");
-  is($last_warning, '', 'no warning issued (as expected)');
+  {
+    no warnings 'XML::Simple';
+    $opt = XMLin($xml, keyattr => { item => 'name' }, @cont_key);
+    is_deeply($opt, $target, "did not fold on specific key with non-scalar 
value");
+    is($last_warning, '', 'no warning issued (as expected)');
+  }
 
   $last_warning = '';
-  $^W = 1;
   my $xitems = q(<opt>
     <item name="color">red</item>
     <item name="mass">heavy</item>
@@ -416,13 +412,14 @@
     'expected warning issued');
 
   $last_warning = '';
-  $^W = 0;
-  $opt = XMLin($xitems, keyattr => { item => 'name' }, @cont_key);
-  is_deeply($opt, $items, "same again");
-  is($last_warning, '', 'but with no warning this time');
+  {
+    no warnings;
+    $opt = XMLin($xitems, keyattr => { item => 'name' }, @cont_key);
+    is_deeply($opt, $items, "same again");
+    is($last_warning, '', 'but with no warning this time');
+  }
 
   $last_warning = '';
-  $^W = 1;
   $xitems = q(<opt>
     <item name="color">red</item>
     <item name="mass">heavy</item>
@@ -448,10 +445,12 @@
     'expected warning issued');
 
   $last_warning = '';
-  $^W = 0;
-  $opt = XMLin($xitems, keyattr => { item => 'name' }, @cont_key);
-  is_deeply($opt, $items, "same again");
-  is($last_warning, '', 'but with no warning this time');
+  {
+    no warnings;
+    $opt = XMLin($xitems, keyattr => { item => 'name' }, @cont_key);
+    is_deeply($opt, $items, "same again");
+    is($last_warning, '', 'but with no warning this time');
+  }
 }
 
 
@@ -485,7 +484,6 @@
 
 # Try parsing a named external file
 
-$@ = '';
 $opt = eval{ XMLin($XMLFile); };
 is($@, '', "XMLin didn't choke on named external file");
 is_deeply($opt, {
@@ -495,7 +493,6 @@
 
 # Try parsing default external file (scriptname.xml in script directory)
 
-$@ = '';
 $opt = eval { XMLin(); };
 is($@, '', "XMLin didn't choke on un-named (default) external file");
 is_deeply($opt, {
@@ -505,7 +502,6 @@
 
 # Try parsing named file in a directory in the searchpath
 
-$@ = '';
 $opt = eval {
   XMLin('test2.xml', searchpath => [
     'dir1', 'dir2', File::Spec->catdir('t', 'subdir'), @cont_key
@@ -520,7 +516,6 @@
 
 # Ensure we get expected result if file does not exist
 
-$@ = '';
 $opt = undef;
 $opt = eval {
   XMLin('bogusfile.xml', searchpath => 't' ); # should 'die'
@@ -531,7 +526,6 @@
 
 # same again, but with no searchpath
 
-$@ = '';
 $opt = undef;
 $opt = eval { XMLin('bogusfile.xml'); };
 is($opt, undef, 'nonexistant file not found in current directory');
@@ -540,17 +534,16 @@
 
 # Confirm searchpath is ignored if filename includes directory component
 
-$@ = '';
 $opt = undef;
 $opt = eval {
   XMLin(File::Spec->catfile('subdir', 'test2.xml'), searchpath => 't' );
 };
 is($opt, undef, 'search path ignored when pathname supplied');
+like($@, qr/Could not find/, 'failed with expected message');
 
 
 # Try parsing from an IO::Handle
 
-$@ = '';
 my $fh = new IO::File;
 $XMLFile = File::Spec->catfile('t', '1_XMLin.xml');  # t/1_XMLin.xml
 eval {
@@ -564,7 +557,6 @@
 # Try parsing from STDIN
 
 close(STDIN);
-$@ = '';
 eval {
   open(STDIN, $XMLFile) || die "$!";
   $opt = XMLin('-');
@@ -1219,13 +1211,11 @@
 
 # Confirm only a hash is acceptable to grouptags and variables
 
-$@ = '';
 $_ = eval { $opt = XMLin($xml, grouptags  => [ 'dir' ]); };
 ok(!defined($_), 'grouptags requires a hash');
 like($@, qr/Illegal value for 'GroupTags' option - expected a hashref/,
 'with correct error message');
 
-$@ = '';
 $_ = eval { $opt = XMLin($xml, variables  => [ 'dir' ]); };
 ok(!defined($_), 'variables requires a hash');
 like($@, qr/Illegal value for 'Variables' option - expected a hashref/,
@@ -1253,12 +1243,10 @@
 
 # Test option error handling
 
-$@='';
 $_ = eval { XMLin('<x y="z" />', rootname => 'fred') }; # not valid for XMLin()
 is($_, undef, 'invalid options are trapped');
 like($@, qr/Unrecognised option:/, 'with correct error message');
 
-$@='';
 $_ = eval { XMLin('<x y="z" />', 'searchpath') };
 is($_, undef, 'invalid number of options are trapped');
 like($@, qr/Options must be name=>value pairs \(odd number supplied\)/,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/2_XMLout.t 
new/XML-Simple-2.22/t/2_XMLout.t
--- old/XML-Simple-2.20/t/2_XMLout.t    2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/2_XMLout.t    2015-12-04 23:08:23.000000000 +0100
@@ -3,6 +3,8 @@
 use warnings;
 use Test::More;
 
+use FileHandle;   # Workaround for test failures on RHEL
+
 plan tests => 201;
 
 
@@ -517,7 +519,7 @@
 ok(!-e $TestFile, 'output file does not exist');
 
 $xml = XMLout($hashref1);
-eval { XMLout($hashref1, outputfile => $TestFile); };
+XMLout($hashref1, outputfile => $TestFile);
 ok(-e $TestFile, 'created xml output file');
 is(ReadFile($TestFile), $xml, 'Contents match expectations');
 unlink($TestFile);
@@ -526,11 +528,9 @@
 # Test output to an IO handle
 
 ok(!-e $TestFile);
-eval {
-  open my $fh, '>', $TestFile or die "$!";
-  XMLout($hashref1, outputfile => $fh);
-  $fh->close();
-};
+open my $fh, '>', $TestFile or die "open(>$TestFile): $!";
+XMLout($hashref1, outputfile => $fh);
+$fh->close() or die "close() failed: $!";
 ok(-e $TestFile, 'create XML output file via IO::File');
 is(ReadFile($TestFile), $xml, 'Contents match expectations');
 unlink($TestFile);
@@ -646,7 +646,6 @@
 # Check undefined values generate warnings
 
 {
-  local($^W) = 1;
   my $warn = '';
   local $SIG{__WARN__} = sub { $warn = $_[0] };
   $ref = { 'one' => 1, 'two' => undef };
@@ -656,10 +655,15 @@
   like($warn, qr/Use of uninitialized value/,
     'caught warning re uninitialised value');
   like($_, $expect, 'undef maps to any empty attribute by default');
+}
 
+{
   # unless warnings are disabled
-  $^W = 0;
-  $warn = '';
+  no warnings;
+  my $warn = '';
+  local $SIG{__WARN__} = sub { $warn = $_[0] };
+  my $expect = qr/^<\w+(\s+one="1"|\s+two=""){2}/;
+
   $_ = XMLout($ref);
   is($warn, '', 'no warning re uninitialised value if warnings off');
   like($_, $expect, 'undef still maps to any empty attribute');
@@ -754,18 +758,15 @@
 # Confirm content key works with undef values (and no warnings)
 
 {
-  $^W = 1;
   my $warn = '';
   local $SIG{__WARN__} = sub { $warn = $_[0] };
-  $_ = eval {
-    $ref = {
-      column => [
-        { name => 'title',   content => 'A Title' },
-        { name => 'sponsor', content => undef },
-      ],
-    };
-    XMLout($ref, suppress_empty => undef, content_key => 'content');
+  $ref = {
+    column => [
+      { name => 'title',   content => 'A Title' },
+      { name => 'sponsor', content => undef },
+    ],
   };
+  $_ = XMLout($ref, suppress_empty => undef, content_key => 'content');
   ok(!$warn,  'no warnings with suppress_empty => undef');
   like($_, qr{^<(\w+)>
       \s*<column\s+name="title"\s*>A\sTitle</column>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/3_Storable.t 
new/XML-Simple-2.22/t/3_Storable.t
--- old/XML-Simple-2.20/t/3_Storable.t  2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/3_Storable.t  2015-12-04 23:08:23.000000000 +0100
@@ -17,8 +17,8 @@
 # Initialise filenames and check they're there
 
 my $SrcFile   = File::Spec->catfile('t', 'desertnet.src');
-my $XMLFile   = File::Spec->catfile('t', 'desertnet.xml');
-my $CacheFile = File::Spec->catfile('t', 'desertnet.stor');
+my $XMLFile   = File::Spec->catfile('t', 'desertnet3.xml');
+my $CacheFile = File::Spec->catfile('t', 'desertnet3.stor');
 
 unless(-e $SrcFile) {
   plan skip_all => 'test data missing';
@@ -28,8 +28,8 @@
 # clock as the machine we're running on.
 
 my $t0 = time();
-unless(open(XML, ">$XMLFile")) {
-  plan skip_all => "can't create test file: $!";
+unless(open(XML, '>', $XMLFile)) {
+  plan skip_all => "can't create test file '$XMLFile': $!";
 }
 close(XML);
 my $t1 = (stat($XMLFile))[9];
@@ -51,16 +51,16 @@
 #
 
 sub CopyFile {
-  my($Src, $Dst) = @_;
+  my($src, $dst) = @_;
 
-  open(IN, $Src) || return(undef);
+  open(my $in, $src) or die "open(<$src): $!";
   local($/) = undef;
-  my $Data = <IN>;
-  close(IN);
+  my $data = <$in>;
+  close($in);
 
-  open(OUT, ">$Dst") || return(undef);
-  print OUT $Data;
-  close(OUT);
+  open(my $out, '>', $dst) or die "open(>$dst): $!";
+  print $out $data;
+  close($out);
 
   return(1);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/4_MemShare.t 
new/XML-Simple-2.22/t/4_MemShare.t
--- old/XML-Simple-2.20/t/4_MemShare.t  2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/4_MemShare.t  2015-12-04 23:08:23.000000000 +0100
@@ -8,7 +8,7 @@
 # Initialise filenames and check they're there
 
 my $SrcFile   = File::Spec->catfile('t', 'desertnet.src');
-my $XMLFile   = File::Spec->catfile('t', 'desertnet.xml');
+my $XMLFile   = File::Spec->catfile('t', 'desertnet4.xml');
 
 unless(-e $SrcFile) {
   plan skip_all => 'test data missing';
@@ -18,8 +18,8 @@
 # clock as the machine we're running on.
 
 my $t0 = time();
-unless(open(XML, ">$XMLFile")) {
-  plan skip_all => "can't create test file: $!";
+unless(open(XML, '>', $XMLFile)) {
+  plan skip_all => "can't create test file '$XMLFile': $!";
 }
 close(XML);
 my $t1 = (stat($XMLFile))[9];
@@ -41,16 +41,16 @@
 #
 
 sub CopyFile {
-  my($Src, $Dst) = @_;
+  my($src, $dst) = @_;
 
-  open(IN, $Src) || return(undef);
+  open(my $in, $src) or die "open(<$src): $!";
   local($/) = undef;
-  my $Data = <IN>;
-  close(IN);
+  my $data = <$in>;
+  close($in);
 
-  open(OUT, ">$Dst") || return(undef);
-  print OUT $Data;
-  close(OUT);
+  open(my $out, '>', $dst) or die "open(>$dst): $!";
+  print $out $data;
+  close($out);
 
   return(1);
 }
@@ -146,6 +146,7 @@
 
 is($opt2->{three}, 3, 'cache was modified');
 
+unlink($XMLFile);
 
 exit(0);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/5_MemCopy.t 
new/XML-Simple-2.22/t/5_MemCopy.t
--- old/XML-Simple-2.20/t/5_MemCopy.t   2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/5_MemCopy.t   2015-12-04 23:08:23.000000000 +0100
@@ -13,7 +13,7 @@
 # Initialise filenames and check they're there
 
 my $SrcFile   = File::Spec->catfile('t', 'desertnet.src');
-my $XMLFile   = File::Spec->catfile('t', 'desertnet.xml');
+my $XMLFile   = File::Spec->catfile('t', 'desertnet5.xml');
 
 unless(-e $SrcFile) {
   plan skip_all => 'test data missing';
@@ -23,8 +23,8 @@
 # clock as the machine we're running on.
 
 my $t0 = time();
-unless(open(XML, ">$XMLFile")) {
-  plan skip_all => "can't create test file: $!";
+unless(open(XML, '>', $XMLFile)) {
+  plan skip_all => "can't create test file '$XMLFile': $!";
 }
 close(XML);
 my $t1 = (stat($XMLFile))[9];
@@ -45,16 +45,16 @@
 #
 
 sub CopyFile {
-  my($Src, $Dst) = @_;
+  my($src, $dst) = @_;
 
-  open(IN, $Src) || return(undef);
+  open(my $in, $src) or die "open(<$src): $!";
   local($/) = undef;
-  my $Data = <IN>;
-  close(IN);
+  my $data = <$in>;
+  close($in);
 
-  open(OUT, ">$Dst") || return(undef);
-  print OUT $Data;
-  close(OUT);
+  open(my $out, '>', $dst) or die "open(>$dst): $!";
+  print $out $data;
+  close($out);
 
   return(1);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/7_SaxStuff.t 
new/XML-Simple-2.22/t/7_SaxStuff.t
--- old/XML-Simple-2.20/t/7_SaxStuff.t  2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/7_SaxStuff.t  2015-12-04 23:08:23.000000000 +0100
@@ -20,13 +20,28 @@
 # Initialise filenames and check they're there
 
 my $SrcFile   = File::Spec->catfile('t', 'desertnet.src');
-my $XMLFile   = File::Spec->catfile('t', 'desertnet.xml');
+my $XMLFile   = File::Spec->catfile('t', 'desertnet7.xml');
 my $CacheFile = File::Spec->catfile('t', 'desertnet.stor');
 
 unless(-e $SrcFile) {
   plan skip_all => 'test data missing';
 }
 
+# Make sure we can write to the filesystem and check it uses the same
+# clock as the machine we're running on.
+
+my $t0 = time();
+unless(open(XML, '>', $XMLFile)) {
+  plan skip_all => "can't create test file '$XMLFile': $!";
+}
+close(XML);
+my $t1 = (stat($XMLFile))[9];
+my $t2 = time();
+
+if($t1 < $t0  or  $t2 < $t1) {
+  plan skip_all => 'time moved backwards!'
+}
+
 
 plan tests => 14;
 
@@ -40,16 +55,16 @@
 #
 
 sub CopyFile {
-  my($Src, $Dst) = @_;
+  my($src, $dst) = @_;
 
-  open(IN, $Src) || return(undef);
+  open(my $in, $src) or die "open(<$src): $!";
   local($/) = undef;
-  my $Data = <IN>;
-  close(IN);
+  my $data = <$in>;
+  close($in);
 
-  open(OUT, ">$Dst") || return(undef);
-  print OUT $Data;
-  close(OUT);
+  open(my $out, '>', $dst) or die "open(>$dst): $!";
+  print $out $data;
+  close($out);
 
   return(1);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/8_Namespaces.t 
new/XML-Simple-2.22/t/8_Namespaces.t
--- old/XML-Simple-2.20/t/8_Namespaces.t        2012-06-20 12:00:21.000000000 
+0200
+++ new/XML-Simple-2.22/t/8_Namespaces.t        2015-12-04 23:08:23.000000000 
+0100
@@ -21,35 +21,6 @@
 
 plan tests => 8;
 
-
-##############################################################################
-#                   S U P P O R T   R O U T I N E S
-##############################################################################
-
-##############################################################################
-# Copy a file
-#
-
-sub CopyFile {
-  my($Src, $Dst) = @_;
-
-  open(IN, $Src) || return(undef);
-  local($/) = undef;
-  my $Data = <IN>;
-  close(IN);
-
-  open(OUT, ">$Dst") || return(undef);
-  print OUT $Data;
-  close(OUT);
-
-  return(1);
-}
-
-
-##############################################################################
-#                      T E S T   R O U T I N E S
-##############################################################################
-
 use XML::Simple;
 
 # Force default behaviour of using SAX parser if it is available (which it
@@ -122,16 +93,16 @@
 };
 
 $xml = XMLout($opt);
-like($xml, qr{
+like($xml, qr[
   ^\s*<opt
   (\s+{http://www.w3.org/2000/xmlns/}perl="http://www.perl.com/";
   |\s+{http://www.perl.com/}attr="value";
   |\s+bare="Beer!"){3}
   \s*>
-  \s*<{http://www.perl.com/}element\s*>data</{http://www.perl.com/}element\s*>
+  
\s*<\{http://www.perl.com/\}element\s*>data</\{http://www.perl.com/\}element\s*>
   \s*</opt>
   \s*$
-}sx, 'clarkian names not converted to qnames on output by default');
+]sx, 'clarkian names not converted to qnames on output by default');
 
 
 # Confirm nsexpand option works on output
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/A_XMLParser.t 
new/XML-Simple-2.22/t/A_XMLParser.t
--- old/XML-Simple-2.20/t/A_XMLParser.t 2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/A_XMLParser.t 2015-12-04 23:08:23.000000000 +0100
@@ -6,10 +6,6 @@
 use File::Spec;
 
 
-# The suppress-able warnings still check the global flag
-
-$^W = 1;
-
 # Initialise filenames and check they're there
 
 my $XMLFile = File::Spec->catfile('t', 'test1.xml');  # t/test1.xml
@@ -41,8 +37,7 @@
 {
   local($SIG{__WARN__}) = \&warn_handler;
 
-  $@ = '';
-  $opt = eval { XMLin('<x y="z" />', nsexpand => 1) };
+  $opt = XMLin('<x y="z" />', nsexpand => 1);
 }
 
 isnt($last_warning, '', "Parsing caused warning (as expected)");
@@ -56,9 +51,8 @@
 {
   local($SIG{__WARN__}) = \&warn_handler;
 
-  $@ = '';
   $last_warning = '';
-  $opt = eval { XMLin('<x y="z" />', ParserOpts => [ ParseParamEnt => 1 ]) };
+  $opt = XMLin('<x y="z" />', ParserOpts => [ ParseParamEnt => 1 ]);
 }
 
 isnt($last_warning, '', "Using ParserOpts caused warning (as expected)");
@@ -70,12 +64,11 @@
 # Check it doesn't happen if warnings disabled
 
 {
+  no warnings;
   local($SIG{__WARN__}) = \&warn_handler;
 
-  $@ = '';
   $last_warning = '';
-  local($^W) = 0;
-  $opt = eval { XMLin('<x y="z" />', ParserOpts => [ ParseParamEnt => 1 ]) };
+  $opt = XMLin('<x y="z" />', ParserOpts => [ ParseParamEnt => 1 ]);
 }
 
 is($last_warning, '', "ParserOpts warning uppressed successfully");
@@ -85,7 +78,6 @@
 
 # Try parsing a string
 
-$@ = '';
 $opt = eval {
   XMLin(q(<opt name1="value1" name2="value2"></opt>));
 };
@@ -101,7 +93,6 @@
 
 # Try parsing a named external file
 
-$@ = '';
 $opt = eval{ XMLin($XMLFile); };
 is($@, '', "XML::Parser didn't choke on named external file");
 is_deeply($opt, {
@@ -111,7 +102,6 @@
 
 # Try parsing from an IO::Handle
 
-$@ = '';
 my $fh = new IO::File;
 $XMLFile = File::Spec->catfile('t', '1_XMLin.xml');  # t/1_XMLin.xml
 eval {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/B_Hooks.t 
new/XML-Simple-2.22/t/B_Hooks.t
--- old/XML-Simple-2.20/t/B_Hooks.t     2012-06-20 12:00:21.000000000 +0200
+++ new/XML-Simple-2.22/t/B_Hooks.t     2015-12-04 23:08:23.000000000 +0100
@@ -12,7 +12,6 @@
 
   skip "Tie::IxHash not installed", 3 if $@;
 
-  $@ = '';
   eval <<'EOF';
 
     package SimpleOrder;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Simple-2.20/t/release-pod-syntax.t 
new/XML-Simple-2.22/t/release-pod-syntax.t
--- old/XML-Simple-2.20/t/release-pod-syntax.t  2012-06-20 12:00:21.000000000 
+0200
+++ new/XML-Simple-2.22/t/release-pod-syntax.t  2015-12-04 23:08:23.000000000 
+0100
@@ -7,9 +7,8 @@
   }
 }
 
+# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
 use Test::More;
-
-eval "use Test::Pod 1.41";
-plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
+use Test::Pod 1.41;
 
 all_pod_files_ok();

++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#no_testing: broken upstream
#sources:
#  - source1
#  - source2
#patches:
#  foo.patch: -p1
#  bar.patch:
#preamble: |-
# BuildRequires:  gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s,  *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL 
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module

Reply via email to