develooper Front page | perl.beginners | Postings from May 2007

Accessing hash

Thread Next
May 28, 2007 03:36
Accessing hash
Message ID:
why is it that when i write
my %hash = (jeevan=>'ingale', sarika=>'bere' );
my @arr = @hash{jeevan, sarika};
print @arr;

prints ingale bere ....
can someone explain me how an @sign is used and what exactly goes in
the secongline of thecode.

contrary when i try something like replacing the @ sign in second line
with % sign which seems more logical it doesnt work

my %hash = (jeevan=>'ingale', sarika=>'bere' );
my @arr = %hash{jeevan, sarika};
print @arr;

if any1 can direct me to document .. it would be helpfull

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About