Thank you very much James and David! Wow! What prompt
responses!
I have some more questions!
I tried "use strict;" and that worked. Are you
encouraging me to use "use warn;" too? That does not
work.
> > # $i receives the proper values
> > foreach my $i (keys %{$x}) {
> > # (4) Why does not this work? How do I index
> into my
> > hash?
> > print "hash i = $i => ".$x{$i}."\n";
>
> Just like you did the array in the other print call
> above, ${$y}{$i}.
What you say works!
What is the name for this syntax: "(keys %{$x})"? Are
we dereferencing and casting? Why do I use "%" here
but when I want to access a specific element, you say
to use the syntax "${$y}{$i}". The index operator {}
needs to work on the entire hash, not a a scalar! By
using a $, we indexing into a scalar, no?
> >
> > my %z= ('d' => 'y', 'f' => 'g');
> > foreach my $i (keys %z) {
> >
> > # (5) Why does $z work instead of %z here?
> > print "z{$i} = $z{$i}\n";
>
> Because we're talking about a single scalar value
> now, not the whole
> hash.
Same question again! Why are we indexing into a
scalar?
Thanks!
Sieg
> > }
>
> Hope this helps.
>
> James
>
>
> --
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]