Site menu:

Back to examples

Perl Example - Hash of Anonymous Hashes

#################################################
#Version 0.1                                    #
#Free to use for any purpose                    #
#No credits or backlink required                #
#Author : Shaji Kalidasan (shajiindia@yahoo.com)#
#################################################
use 5.010;
use strict;
use warnings;

my %team = ( 
                India => {Tendulkar => 100, Dhoni => 98},
                Australia => {Border => 87, Boon => 120}
           );

say "In Border Gavaskar Cup, Tendulkar scored : ", $team{India}->{Tendulkar};