Thank you. Very much...

I get it, but - but would like to clarify. I give the node to a new document outside my loop, like this:

my $foster_home = XML::LibXML::Document->new("1.0", "UTF-8"); # Register the namespaces: $cve_xc->registerNs( def => 'http://scap.nist.gov/schema/feed/vulnerab +ility/2.0' ); $cve_xc->registerNs( vuln => 'http://scap.nist.gov/schema/vulnerabilit +y/0.4' ); $cve_xc->registerNs( cvss => 'http://scap.nist.gov/schema/cvss-v2/0.2' + ); # Find the appropriate CVE entry in the data source: for my $entry ( $cve_xc->findnodes( "/def:nvd/def:entry[\@id = '$cve_i +d']" )) { if ( my ( $metrics ) = $cve_xc->findnodes( 'vuln:cvss/cvss:base_me +trics', $entry )) { ($av) = $cve_xc->find('cvss:access-vector', $metrics); ($ac) = $cve_xc->find('cvss:access-complexity', $metrics); ($au) = $cve_xc->find('cvss:authentication', $metrics); ($ci) = $cve_xc->find('cvss:confidentiality-impact', $metrics) +; ($ii) = $cve_xc->find('cvss:integrity-impact', $metrics); ($ai) = $cve_xc->find('cvss:availability-impact', $metrics); } else { $av = ""; $ac = ""; $au = ""; $ci = ""; $ii = ""; $ai = ""; } } $av->setOwnerDocument($foster_home); $ac->setOwnerDocument($foster_home); $au->setOwnerDocument($foster_home); $ci->setOwnerDocument($foster_home); $ii->setOwnerDocument($foster_home); $ai->setOwnerDocument($foster_home);

But I'm a little confused as where to go from here: my $doc = $node->ownerDocument;

I'm also stymied at the moment as I'm getting "Can't locate object method "setOwnerDocument" via package "XML::LibXML::NodeList" at..."

I've reinstalled XML::LIbXML via CPAN, have "Node.pod" in /Library/Perl/5.10.0/darwin-thread-multi-2level/XML/LibXML, but only NodeList.pm...


In reply to Re^4: XML::LibXML memory leak by spstansbury
in thread XML::LibXML memory leak by spstansbury

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.