如何在我的 Perl 脚本中填充哈希(已在单独的文件中定义)并对其进行必要的操作?
例如:
file1.pl -- 包含定义的哈希,
file2.pl -- 用户定义的代码,应该从 file1.pl 填充散列
my %tgs = (
'articles' => {
'vim' => '20 awesome articles posted',
'awk' => '9 awesome articles posted',
'sed' => '10 awesome articles posted'
},
'ebooks' => {
'linux 101' => 'Practical Examples to Build a Strong Foundation in Linux',
'nagios core' => 'Monitor Everything, Be Proactive, and Sleep Well'
},
);