Skip Menu |

This queue is for tickets about the XML-Simple CPAN distribution.

Report information
The Basics
Id: 41562
Status: resolved
Priority: 0/
Queue: XML-Simple

People
Owner: Nobody in particular
Requestors: haa [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.16
Fixed in: (no value)



Subject: use with :strict sets global flag breaking modules use:ing without :strict
When you say "use XML::Simple qw(:strict)" it sets a global(!) flag in XML::Simple, turning strict mode on for everyone using XML::Simple, even if the other modules use it without :strict. The behaviour of setting global flags based on "namespace importing syntax" as a side-effect feels somewhat fickle behaviour. This can be a real problem for larger systems where you have many (legacy) modules using XML::Simple, most of them without the :strict option and relying on the older API behaviour. It seems that ForceArray => 0 and KeyAttr => [] are probably "safe" to add to XMLin calls without these parameters to work around this but changing XML parsing flags seems somewhat risky.
I would be happy to consider a patch to make this behaviour lexically scoped, or at the very least scoped to the calling namespace.
Fixed in XML-Simple-2.19_01 (stable release to follow). Thanks for the report.