The documentation for ref (for which my code is essentially a wrapper) mentions a possible return value of LVALUE. When does this happen?
An LVALUE is something that can be assigned to (ie can appear on the left hand side of =. An easy way to see it returned from ref is by...
my $str = "hello"; print ref \substr( $str, 0, 2 );

The docs also mention different behavior "If the referenced object has been blessed into a package". (I don't really have a question about this, other than that I don't understand it. Grokking object-oriented Perl is my next quest.)
Compare the output from these two print statements
print ref {}; print ref bless {}, "MyObject";

How can I create a circular reference? If I do, is there a sane way to represent it?
See what Data::Dumper does with circular references? DD is usually quite sensible.
Is there a sexier way to handle code references? In particular, can I get it to print the name of the subroutine (if there is one)?
You could look at B::Deparse, which will decompile a coderef.

Update: I don't think you can get the sub's name, though

Is there a way I can use the debugger to stop at a certain point and execute my code (if, say I prefer to use it over the debugger's x command)?
Yes. If you start the program running under the debugger, $DB::single = 1 will force entry into the debugger. You can then execute any Perl code you like. (It might be DB::Single, but I'm fairly sure it's lowercase 's'.)

update: fixed a couple of typos & added deparse disclaimer


In reply to Re: Data structure examiner by FunkyMonk
in thread Data structure examiner by dbw

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.