Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: to sort hash wrt values corresponding to keys

by GrandFather (Cardinal)
on Nov 02, 2011 at 06:07 UTC ( #935304=note: print w/ replies, xml ) Need Help??


in reply to to sort hash wrt values corresponding to keys

Your post title is "Comment on" so I will.

First off "Comment on" is a bad title if you want to attract people to your question. It tells them nothing about the topic of your question and looks like a lazy newbie question so anyone with only a small amount of time is likely to skip over it. You have immediately filtered out some of the people most likely to be able to help you. Is that what you want? It sure doesn't help get good answers!

The 'code' you posted is rubbish, or at least it is rubbish if intended to be Perl. We always consider the syntax. If you are too lazy to provide a decent code sample that we can work with you just filtered out another large percentage of the people who might otherwise have given you good answers.

You say "output should be say", but you don't show us the code you are using to generate the output. How can we have any idea what you are actually trying to achieve? Your example data is obviously invented and doesn't tell us anything about your actual problem domain. Want to guess how many more possible replies you just lost?

Your final question doesn't have anything to do with any of the preceding material. If you fixed the syntax for your sample 'code' then you have the answer right there! Ain't many people going to bother replying to that.

So, I suggest:

  1. you use a good title for your question that will attract people with and interest and knowledge pertinent to your problem,
  2. you provide a good code sample that compiles and that we can run to reproduce the problem you have,
  3. you provide a description of why you want to solve the problem and how the code you have shown fails
  4. you provide a very small amount of input data if appropriate,
  5. you provide a sample of expected output data if appropriate,
  6. you provide a sample of actual output showing the error if appropriate,
  7. that you do the work to write a good node because that is actually the lazy option in the long run!
True laziness is hard work


Comment on Re: to sort hash wrt values corresponding to keys

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-12-27 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls