![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Increasing the efficiency of the codeby Limbic~Region (Chancellor) |
on Nov 29, 2006 at 13:08 UTC ( #586684=note: print w/replies, xml ) | Need Help?? |
Anonymous Monk,
I have re-written your code Please feel free to ask questions, but try to find the answers on your own first. See Coping with Scoping and perldoc (also available from the command line) for starters. The trick I did to avoid the if/eslif chain is called a dispatch table. Update: As GrandFather points out in his node, your use of $col is likely incorrect. I set $col to the last value of the sorted %cols_pos keys on the assumption you thought that is the value it would be after the loop. If $col is set elsewhere in your code then you will need to change this accordingly. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|