" eval 'no XML::Simple';" that probably did nothing. XML::Simple probably does not have or inherit an unimport sub. You can always ->import() ->unimport() any package and it will always "work", because of a special exception in the interp for those 2 method calls.
CProcess->PrintProcessInfo("perl.exe");
eval 'use XML::Simple';
CProcess->PrintProcessInfo("perl.exe");
{
my $xs = new XML::Simple();
my $root= $xs->XMLin('D:\xTools\test\xmltest.xml');
CProcess->PrintProcessInfo("perl.exe");
undef $root;
undef $xs;
}
CProcess->PrintProcessInfo("perl.exe");
Try that. Perl will always destroy at a scope boundary/change. Reassigning may or may not trigger a DESTROY (I don't exactly).
If you are desperate on memory you can try
Symbol's delete_package and/or unloading XS modules (I'm not describing how to do that at the moment). Neither (delete_package/unloading an XS module) are guaranteed to free all memory. With a Perl that old, there are probably leaks that you can't fix without a newer version of Perl.
I also see "Threads 3", are you using ithreads? On a Perl that old they are alpha.