in reply to Re^3: Top n Unique count from Array
in thread Top n Unique count from Array

Dear Anonymous Monk, I am not a programmer, I have very basic perl knowledge. I am learning perl by following tutorials online and continue to do so. This is the first time I am working on hash and was hoping someone to explain me in a better way. I already posted what I tried, but you keep on asking me the answer for my question. I know my code is not good but it works, I just wanted some simple explanation of this.

Replies are listed 'Best First'.
Re^5: Top n Unique count from Array
by Anonymous Monk on Mar 25, 2011 at 11:36 UTC
    I already posted what I tried, but you keep on asking me the answer for my question.
    No, I asked you to answer my questions; you did not answer them. This is how to learn to become a programmer, you ask yourself these questions, and try to answer them.

    If you're stuck, you speak the questions out loud and ask the empty room. Does you understand the question? Would another person understand the question? Does the answer make sense?

    If you're still stuck, you ask on perlmonks, and when monks ask you questions, you try to answer their questions.

    This is how you learn to become a programmer.

    I know my code is not good but it works, I just wanted some simple explanation of this.
    Well, you asked to acheive similar output but from array not an explanation; did you want to ask for an explanation of something?

    In this reply you say UPDATE: Looks like I found the solution. This one is working for me: , but the code is exactly what you had in the beginning, you just changed the variable name, so are you sure its the solution?

      You are right, Is there any way I can get the Top results in a Hash ?
      print "$key\t$cnt_hash{$key}\n"; Is there any way that output of this print command can be pushed in an array or hash ?
      So next time when I print that hash, It will print the same output.
      I want to insert print "$key\t$cnt_hash{$key}\n"; in Tk entry widget.