in reply to Re: sorting arrays...
in thread sorting arrays...

Thanks, worked great!:)

I see that if I change [1] to [0] I can sort by the first item in the array... what is there are 3, 4, or 5 items in the array? Can I keep adding to the byPhone sub? $c, $d etc?

Replies are listed 'Best First'.
Re: Re: Re: sorting arrays...
by dws (Chancellor) on Jul 12, 2003 at 23:31 UTC
    Can I keep adding to the byPhone sub? $c, $d etc?

    While sorting, $a and $b (and only those two) are special. They've been localized, and hold the two items being compared for sorting purposes. All is explained in perlfunc in the section on sort.

    Since you started with the ActiveState distribution, you'll have all of the core Perl docs available via Start | Applications | ActiveState Perl.