
Cameron
Deleted
Aug 14, 2000, 1:40 PM
Post #2 of 3
(27235 views)
|
The @new array is left unchanged at 5, 2, 4, 8; How? I don't have my books handy, but i think it goes something like this. First the call is made to Sort::cure, where $a and $b are package global variables. These should be qualified with the package name of the caller, since the sort routine is not in the same package as the caller Since $a and $b are out of scope, the subroutine returns '0' for each call. Then sort compares the values returned from Sort::cure, and since they are all '0', the order remains unchanged. This populates the @new array with the unchanged list of values. Cameron
|