hi,,,currently im reading the "Intermediate Perl" book. im being bugged by the anonymous data structures. a part of the book it says that anonymous data structures are structures that do not have explicit names. so i understand (correct me if im wrong) that this "names" that is being point out, would be like ($my_ref, $var, $_, etc...) that is implicitly created by perl.

as we could see on the example below:

for (@_) { print; $_ = undef; }

we all knew that the implicit variable here is $_ that is being printed out. so in connection with creating anonymous data structures below:

my $ref = ["my","list"];

what would be that implicit name (variable) that was created? and how can i access it?

if i was wrong of pointing out that this "name" is a variable rather was a memory address, then it means:

EXPLICIT NAME: $var

IMPLICIT NAME (memory address): 0x25512

VALUE: perl

am i right? that there are two ways to access a value, by using the explicit name, and through an implicit name.

thanks in advance... keep deep and dark!

From: PerlPhi


In reply to Anonymous Data Structures by PerlPhi

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.