I think you have to enter the local variables $a and $b into the caller's namespace.
In reply to Re: How to get sort-like semantics? by moritz in thread How to get sort-like semantics? by b4swine