Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
sorting routines, mapping and code styleby moxliukas (Curate) |
on Jul 19, 2002 at 13:55 UTC ( [id://183233]=perlquestion: print w/replies, xml ) | Need Help?? |
moxliukas has asked for the wisdom of the Perl Monks concerning the following question: Hello monks, I am not very proficient at Perl (yet), therefore I would like to as you for some help. I have failed to start Robomonk because it needed some modules that refused to compile for me (probably because I didn't have root access), therefore I decided to wrtie a simple IRC bot, that would fetch my XP and XP of my Lithuanian fellows. After some coding the bot runs OK, however I am not very happy with it, mostly because of the weird sorting routine that I wrote (I am sure it could be simplyfied) and some other bits and pieces. The reason why this bot doesn't fetch the XP values straight from perlmonks, but from lietuvoje.lt is because I have written this code before for displaying XP stats on a mobile phone via WAP/WML (reusing code is a Good Thing (TM), right?) However I feel that this code should also be rewritten to fetch things straight from perlmonks, because it is sloooow. So what I am asking you is to give me ideas how to make this code more efficient (especially that ugy sorting routine) The input at lietuvoje.lt looks like this:
I want to sort that in descending order by XP and display it on IRC. Here is the code:
PS. As I am writting this, I have already noticed that I should really give more descriptive names for variables... I promise I will always try to do this in future ;)
Back to
Seekers of Perl Wisdom
|
|