Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Sorting the numbers: A little tricky.

by flexvault (Parson)
on Jan 25, 2013 at 14:30 UTC ( #1015354=note: print w/ replies, xml ) Need Help??


in reply to Sorting the numbers: A little tricky.

oxydeepu,

Like everyone else, it is hard to understand the math. But your original question can be answered by reading the file one line at a time, do a 'chomp' and then 'split' the line into 2 strings. Then using a hash, populate it with keys and values where the value is greater than 4.

Now you can process your hash using a 'foreach' with a numeric 'sort' of the 'keys' of the hash, and use whatever Perl math code you want to get whatever results you want.

Like all things in Perl, this is one of many ways to do it, so experiment.

Good Luck

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Sorting the numbers: A little tricky.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-09-18 20:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls