这是我的问题:
我有一个像数据结构的文件系统:
%fs = (
"home" => {
"test.file" => {
type => "file",
owner => 1000,
content => "Hello World!",
},
},
"etc" => {
"passwd" => {
type => "file",
owner => 0,
content => "testuser:testusershash",
},
"conf" => {
"test.file" => {
type => "file",
owner => 1000,
content => "Hello World!",
},
},
},
);
Run Code Online (Sandbox Code Playgroud)
现在,为了得到/etc/conf/test.file我需要的内容$fs{"etc"}{"conf"}{"test.file"}{"content"},但我的输入是一个数组,看起来像这样:("etc","conf","test.file").
因此,因为输入的长度是变化的,所以我不知道如何访问散列的值.有任何想法吗?