You might want to look into Devel::Peek:

#!/usr/bin/perl use strict; use warnings FATAL => qw(all); use Inline 'C'; use Devel::Peek; my $test = eg(); Dump( $test ); $test = undef; __DATA__ __C__ SV *eg () { HV *rv = newHV(); hv_store(rv, "x", 1, newSVpv("hello", 0), 0); return newRV_noinc((SV*)rv); }

Outputs:

C:\test>junkic SV = RV(0x267460) at 0x267450 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0x2d0200 SV = PVHV(0x357b620) at 0x2d0200 REFCNT = 1 FLAGS = (SHAREKEYS) ARRAY = 0x36132d8 (0:7, 1:1) hash quality = 100.0% KEYS = 1 FILL = 1 MAX = 7 RITER = -1 EITER = 0x0 Elt "x" HASH = 0x9303a5e5 SV = PV(0x37cf50) at 0x37f128 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x36d2f18 "hello"\0 CUR = 5 LEN = 8

Which looks fine, but only serves to tell us that what you've posted isn't indicative of your actual code.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: Tracing memory leak by BrowserUk
in thread Tracing memory leak by halfcountplus

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.