没有必要设置这么多hash吧
用个引用好了
比如
$info = {
$num -> {
$key -> value
}
......
}
2009/2/15 Lee Duhem <[email protected]>
> 2009/2/15 allen <[email protected]>:
> > 那我定义一下格式: $num $name $value
> > 从某一个文件中获得这3个值
> > 然后根据$num的多少自动生成相应的hash
> > 比如 2 张三 5
> > 生成 的hash 为 hash_2 其中的key 张三 对应的值为5
> > 再比如 4 李四 6 生成的hash 为hash_4 其中的key 李四 对应的值为6
> >
>
> 重新设计你的数据结构吧,例如说用一个 hash 引用的数组代替你的 hash_1, hash_2, ...
>
> lee
>
> >
>
--
Yours Sincerely
Zeng Hong
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
要在此论坛发帖,请发电子邮件到 [email protected]
要退订此论坛,请发邮件至 [email protected]
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---