"Bob Ackerman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Monday, July 8, 2002, at 12:46  AM, Todd Wade wrote:
>
> >
> > "Patricia Hinman" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Does anyone know of a routine that will sort arrays by
> >> size.  I need to sort any number of given arrays, and
> >> operate on the largest to the smallest.
> >>
> >> I've just recently learned of the
> >> @nums = sort{$a<=>$b} @numbers;
> >>
> >> hope the answer for arrays is as simple.
> >>
> > Youre in luck then:
> >
> > $ perl -e 'print(sort({$a <=> $b} (7,3,4,9,5,6,1,8,2,)), "\n");'
> > 123456789
> >
> > Todd W.
> >
>
> doesn't op want to sort a set of arrays based on the size of each array?
>
> i have:
> @x1 = ('a','b','c');
> @x2 = ('d','e');
> @x3 = ('f','g','h','i');
>
> @s = sort {@$a <=> @$b} (\@x1,\@x2,\@x3);
> print "@$_\n" for @s;
> --------
> outputs:
> d e
> a b c
> f g h i
>

Time for bed!!! Yes, sorry Patricia if this led to any confusion.

btw, the cool thing about perl is its still just as simple =0).

Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to