in reply to Re: Re: Sort and related stuff
in thread Sort and related stuff

This solution has the same problems as my my-predeclare solution has. If somebody is stupid enough to assign something to $a and $b, then this method won't work for the single-call case. But on the other side, the single-call case will never work, if somebody actually uses variables called $a and $b in any way other than within a sort-callback.

Replies are listed 'Best First'.
Re (tilly) 4: Sort and related stuff
by tilly (Archbishop) on Feb 24, 2001 at 07:17 UTC
    No. Your my-declaration had the problem that you changed $a and $b to lexical variables, so when the sort function was setting the globals $a and $b, the function looked at the wrong variables.

    Let us not mention the fact that your example assumed that the data never would include false values...