in reply to Re: sort mechanism
in thread sort mechanism

I just bumped into this behavior when asking the confused question in Evaluation Disorder. As it turns out, sort always returns false in a scalar context, not the length of the returned list, as one might assume.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Replies are listed 'Best First'.
Re: Re: Re: sort mechanism
by satchboost (Scribe) on Apr 06, 2001 at 22:01 UTC
    My question then becomes where would this be documented? How would I known this without playing around? (Granted, the playing was still fun and enlightening, but that's not the point.)
      It should be documented in sort, but it is not. Probably because they didn't think up useful behaviour and didn't want to document intentionally useless behaviour. (Though I would have preferred to see fatally useless behaviour, or at least a warning...

      Personally I think that sort in scalar context should sort the array in place. But that is just me...