PerlPhi has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Anonymous Data Structures
by bart (Canon) on Jun 01, 2007 at 10:51 UTC | |
|
Re: Anonymous Data Structures
by shmem (Chancellor) on Jun 01, 2007 at 11:14 UTC | |
|
Re: Anonymous Data Structures
by Herkum (Parson) on Jun 01, 2007 at 11:07 UTC | |
by lwicks (Friar) on Jun 01, 2007 at 15:56 UTC | |
by Herkum (Parson) on Jun 01, 2007 at 21:12 UTC | |
|
Re: Anonymous Data Structures
by FunkyMonk (Bishop) on Jun 01, 2007 at 11:12 UTC | |
by blazar (Canon) on Jun 04, 2007 at 08:21 UTC | |
|
Re: Anonymous Data Structures
by agianni (Hermit) on Jun 01, 2007 at 15:23 UTC | |
by blazar (Canon) on Jun 01, 2007 at 15:40 UTC | |
by agianni (Hermit) on Jun 01, 2007 at 18:16 UTC |