playingwithbots has asked for the wisdom of the Perl Monks concerning the following question:

I'm using ActivePerl 5.8.0 build 804. When I use XML::SImple and do the new call, I get the following:

lock can only be used on shared values at :/Perl/site/lib/XML/Simple.p +m line 47 7.

my code is:

$xs = new XML::Simple(noattr => 1, keeproot=>1, searchpath=>".", suppr +essempty=>"");

I have sort of figured out how to fix this in the XML::Simple code, but I guess I don't think this should be happening. Any ideas? I'm running Windows XP.

Replies are listed 'Best First'.
Re: XML::Simple lock issue
by grantm (Parson) on Apr 27, 2003 at 19:00 UTC

    As you've discovered, you need version 2.00 or later. The locking code that was put in to ensure thread safety under Perl 5.005 was not compatible with the new threading model under 5.8.

Re: XML::Simple lock issue
by PodMaster (Abbot) on Apr 27, 2003 at 16:00 UTC
    What version of XML::Simple? I got the same perl
    perl -MXML::Simple -e "XML::Simple->new and die XML::Simple->VERSION" 1.06 at -e line 1.
    Just in case
    perl -MXML::Simple -e"XML::Simple->new(noattr => 1, keeproot=>1, searc +hpath=>q[.], suppressempty=>[]) and die XML::Simple->VERSION" 1.06 at -e line 1.


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

      Version is 1.06. Comes with the ActivePerl install
Re: XML::Simple lock issue
by playingwithbots (Novice) on Apr 27, 2003 at 17:48 UTC
    OK, I just want to CPAN and downloaded version 2.05 (I think) of XML::Simple and it seems to now run just fine.