Re:confused about reference
- From: pangj@xxxxxxxxxxx (Jeff Pang)
- Date: Fri, 31 Oct 2008 05:19:37 +0100 (CET)
Message du 31/10/08 04:08Here $yahoo is a hash reference (or say it's pointing to an anonymous hash), you could declare it as $yahoo = {};
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?
$yahoo->{yahoo} points to a hash value whose key is 'yahoo'.
This value is an anonymous array, say it's $yahoo->{yahoo} = [1,2,3].
so @{$yahoo->{yahoo}} will derefer the anonymous array, you will get an array of (1,2,3) finally.
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.
- Prev by Date: confused about reference
- Next by Date: Re: confused about reference
- Previous by thread: Re: confused about reference
- Next by thread: Re:confused about reference
- Index(es):
Relevant Pages
|