From: Marc Girod on
On Jul 7, 7:11 pm, Marc Girod <> wrote:

I was pointed the documentation (which I had failed to read well
enough--embarrassing as this is the first paragraph):

In list context, this sorts the LIST and returns the sorted list
value. In scalar context, the behaviour of "sort()" is undefined.

OK. Now I know that 'undefined' may mean 'stack corruption'.
Cave canem... er, caveat emptor, I meant.

The fix is thus:

return wantarray? sort keys %co : scalar keys %co;

First  |  Prev  | 
Pages: 1 2
Prev: export symbols
Next: Checking Perl 5.8.0 programs.