WHY? This is suddenly very frustating. Maybe some one here can help me get around this problem. I have a set of strings with a prefered sort order. So I wrote a hash associating each string to it's position in the sort order, and then a sub SortByMyOrder method to do the look ups. It gets used in lots o' places, so I moved it into a small package. But now it doesn't work any where because $a and $b are not in the right package. I could solve this with eval and caller, but I don't want to do that because qsort could potentially make lots o' calls into this method. How can I tell Perl to get the $a and $b scopes correct?
In reply to package globals and sort() by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |