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

This way sorted the name and not the number?

Replies are listed 'Best First'.
Re: Re: Re: sorting arrays...
by artist (Parson) on Jul 12, 2003 at 22:33 UTC
    Sorry about my mistake in reading your question:
    Replace this:
    my %hash; while ($whatever = <TOSORT>) { chomp $whatever; my($name,$number) = split(/\|/, $whatever); $hash{$number} = $name; } foreach my $number (sort keys %hash){ my $name = $hash{$number}; print "$name\|$number"; }
    artist
      Thanks! :)