The general reference for all references, including symbolic ones is perlref and a basic intro can be found in perlreftut. You should likely read through both.

Under most circumstances, you should avoid symbolic references since they make debugging more difficult, security can be comprimised and nearly everything you can do with them can be done with ordinary, "hard" references. There are exceptions (e.g. manipulating the symbol table), and those are discussed in the relevant section of perlref. The basic concept behind them is rather than storing the memory address of the variable of interest, as is done with normal references, you store in your variable the name of a variable of interest. This is then dereferenced using the same syntax. So, for example you could do the following:

my $string = 'Hello World!'; my $var_name = 'string'; print ${$var_name};

The scalar dereference looks through the lexical space to see if it can find a scalar variable named 'string', and then when it does, performs the substitution.


In reply to Re: Hard reference vs Soft/Symbolic reference by kennethk
in thread Hard reference vs Soft/Symbolic reference by perlpal

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.