Created
February 3, 2018 08:31
-
-
Save note103/6e231421e2d464acbe5ca4337444b281 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
# 1 | |
my %japan = ( | |
tokyo => [ 'gotanda', 'shibuya', ], | |
osaka => [ 'shinsaibashi', ], | |
okinawa => [ 'naha', 'yomitan', ], | |
hokkaido => [ 'sapporo', 'obihiro', ], | |
fukuoka => [ 'hakata', ], | |
); | |
# 2 | |
print $japan{tokyo}[0]."\n"; | |
print $japan{hokkaido}[0]."\n"; | |
# 3 | |
$japan{osaka}[1] = 'umeda'; | |
# 4 | |
use Data::Dumper; | |
print Dumper \%japan; | |
__END__ | |
gotanda | |
sapporo | |
$VAR1 = { | |
'tokyo' => [ | |
'gotanda', | |
'shibuya' | |
], | |
'okinawa' => [ | |
'naha', | |
'yomitan' | |
], | |
'fukuoka' => [ | |
'hakata' | |
], | |
'osaka' => [ | |
'shinsaibashi', | |
'umeda' | |
], | |
'hokkaido' => [ | |
'sapporo', | |
'obihiro' | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment