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

Accessing hash

Thread Next
From:
jeevs
Date:
May 28, 2007 03:36
Subject:
Accessing hash
Message ID:
1180333544.664452.290440@z28g2000prd.googlegroups.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About