我是一个Perl人,我已经做了一段时间的哈希:
my %date;
#Assume the scalars are called with 'my' earlier
$date{$month}{$day}{$hours}{$min}{$sec}++
现在我正在学习Ruby,到目前为止我发现使用这个树是做许多键和值的方法.有没有办法使用我用Perl使用一行的简单格式?
@date = {
month => {
day => {
hours => {
min => {
sec => 1
}
}
}
}
}