Hello,

Thanks for the clarification. I am going to borrow a colleagues Advanced Perl Programming and read some more (I foolishly thought I understood references).

I still think it would be nice (but maybe impossible?) to find out what refers to a particular piece of data/value. I understand that there is a reference count that means that even if a lexical goes out of scope if it has been referenced and the reference is still in scope then the value will be preserved.

After reading your reply and Programming Perl again, I now see that the reference is basically a one way link between reference and the value (referent). The diagram 8.1 (from Programming Perl) is particularly useful. It seems like this is one case where symbolic references are the ones to use. (It has been hammered into me that soft references are bad.....)

Many Thanks for everybodys help.


In reply to Re: Re: Getting a variable name from a reference by Fool on the Hill
in thread Getting a variable name from a reference by Fool on the Hill

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.