1
一个subrotuine争论越来越哈希REF:如何找到哪种类型的传递给函数
sub test {
my $hash_ref = shift ;
if ($hash_ref->{app}) {
...
}
TheHash裁判的样子以下格式:如何找出它有什么类型的数据
#scallar
$hash {app} = 'app' ;
(or)
#array
$hash {app} = ['app1' ,'app2' ,'app3'];
(or)
#hash
$hash {app} = { app1 => { type => 1, contact=> abc }}
(or)
#array +hash
$hash {app} = [{ app1 => { type => 1, contact=> abc }} ,
{ app2 => { type => 2, contact=> ded }}]
如何处理这种类型的数据结构