From: Jerry Preston <[EMAIL PROTECTED]> > I am trying to figure out an easy way to sort out a array of numbers: > > 2 20 38 56 75 93 -17 -35 -53 -72 -90 > > Into the following: > > -90 -72 -53 -35 -17 2 20 38 56 75 93 > > I have done the following: > > @x_step = grep { ! $x_step_t{ $_ } ++ } @x_step_t; > > @x_step = sort {$a == $b} @x_step;
You should use <=>, not == in here: @x_step = sort {$a <=> $b} @x_step; Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]