1: my %hash;
2:
3: my @bee = ("Propolis", "Honey");
4: my @cow = ("Beef", "Milk");
5: my @hen = ("Chicken", "Egg");
6:
7: $hash{"Bee"} = \@bee;
8: $hash{"Cow"} = \@cow;
9: $hash{"Hen"} = \@hen;
10:
11: my $pHash = \%hash;
12:
13: my $pa = $pHash->{"Cow"};
14: print(@$pa); print "\n";
15: print($pa->[0]); print "\t";
16: print($pa->[1]); print "\n";
Saturday, January 12, 2013
Perl에서 array 들로 이루어진 hash 의 pointer 다루기 예
Labels:
Perl
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment