Printing Perl Hash Keys

前端 未结 3 1212
难免孤独
难免孤独 2021-02-07 11:37

I am trying to print out my Hash Keys in Perl, one per line. How would I go about doing this?

3条回答
  •  囚心锁ツ
    2021-02-07 12:21

    We can done this by using map function.

    map {print "$_\n"} keys %hash; 
    

    map function process its statement for every keys in the hash.

提交回复
热议问题