This was my first guess, but I'm sure there are better
ways:

my @ary = qw(exon1
             exon5
             exon12
             exon30
             exon2);

@ary = sort by_exon_num @ary;

print join("\n", @ary), "\n";

sub by_exon_num {
        $a =~ /(\d+)/;
        my $a_dig = $1;
        $b =~ /(\d+)/;
        my $b_dig = $1;
        $a_dig <=> $b_dig;
}

HTH

Regards,
David

--- Adam Witney <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am trying to sort a list like this
> 
> exon1
> exon5
> exon12
> exon30
> exon2
> 
> Into ->
> 
> exon1
> exon2
> exon5
> exon12
> exon30
> 
> Any ideas on how to do this?
> 
> Thanks
> 
> adam


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to