in reply to Applying ASC sort with RAND?

^C If problem X is how to reference the array so as to give it to the perl sort function ...
my $coderef = # your code above print map { "$_\n" } sort @{$coderef() -> { catrand }};
^B Of course, just replacing the RAND() with ASC would have exactly the same effect, which is why I think you really want to know about referencing in Perl.
__________________________________________________________________________________

^M Free your mind!

Key to hats: ^I=white ^B=black ^P=yellow ^E=red ^C=green ^M=blue - see Moron's scratchpad for fuller explanation.