Re:confused about reference







Message du 31/10/08 04:08
De : "Richard Lee"
A : "Perl Beginners"
Copie à :
Objet : confused about reference



I was just testing some reference and while trying out below I am trying
to understand below

@{$yahoo->{yahoo}}........... I can see that this is pointing to 0,1,3
by running the code.
But I am trying to really understand whether this is trying to say since
value of 'yahoo' is array put @ at the front?
or @ is there because it's array slice??
Can someone explain this?

Also, %{$base[0]}, trying to understand this.
According to the tutorial,

%base referenced is %{$base}

what is the difference between %{$base[0]} vs %{$base}[0]


%{$base}[0] is just a syntax error.
$hash->{$base}[0] is effective syntax.

For %{$base[0]}. $base[0] is an anonymous hash (or hash reference), %{...} will derefer it.


Jeff.
http://home.arcor.de/pangj/

Créez votre adresse électronique prenom.nom@xxxxxxxxxxx
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.


Relevant Pages

  • Re: VB-101: Passing Arrays ByVal vs ByRef
    ... changed if an array is passed by Val. ... ' new reference ... As each function creates a new array object, ... 'secondArray' and 'secondArrayCopy'. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Need help with textboxes
    ... The JavaScript 1.5 Reference already states: ... All forms and their children are stored in an array ... use dot notation or object literals. ... No. Bracket property accessors allow their argument to be any string value. ...
    (comp.lang.javascript)
  • Re: Garbage Collection Issues in long-standing services
    ... the pinned array should get unpinned or ... The receive case is done quite well, I do create a 4K buffer and reuse it ... and remove the reference to my wrapper socket class, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to give selective access to the methods in a class?
    ... different memory locations at different times. ... The reference still leads to the ... So array resizing ... program pushes certain objects into the circular buffer, ...
    (comp.lang.java.programmer)
  • Re: Perlish map() function
    ... the reference material, the Array constructor was introduced in JavaScript ... evaluation would result in a ReferenceError. ... identifier shows that it is true. ...
    (comp.lang.javascript)