美文网首页
匿名hash

匿名hash

作者: 余绕 | 来源:发表于2020-04-20 16:40 被阅读0次
    $ref={'ATGC'=>1,'GATC'=>2,'ATGCG'=>3}; #匿名hash用{}表示,引用还是$
    
    
    print "Here is what in the reference\n";
    
    print "$ref\n";
    
    @a=keys %$ref;
    @b=values %$ref;
    
    print "@a\n";
    
    
    print "@b\n";
    
    

    打印结果

    Here is what in the reference
    HASH(0x6cc570)
    ATGCG ATGC GATC
    3 1 2
    
    

    相关文章

      网友评论

          本文标题:匿名hash

          本文链接:https://www.haomeiwen.com/subject/fiwdihtx.html