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] Are we here talking about first being hash reference which first item is array reference vs second one is hash reference's first item ?

thank you.

#!/usr/bin/perl

use warnings;
use strict;
use Data::Dumper;

my $yahoo = { 'yahoo' => [ 0, 1, 3],
             'msn' => [ 12, 32, 44]
           };

print Dumper($yahoo);

print "\n\n\n\n\n------------------------------------------------------------\n";

print "${$yahoo}{yahoo}[0]\n";   # prints 0
print "$yahoo->{yahoo}[0]\n";    # prints 0
print "@{$yahoo->{yahoo}}\n";    # prints 0,1,3
print "%{$yahoo->{yahoo}}\n";    # print %{ARRAY(0x832e8c4)}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to