1 2
my @unsorted = <IN>; my @sorted = sort {($a=~/chr(\d+)/)[0] <=> ($b=~/chr(\d+)/)[0]}@unsorted;
my @unsorted = <IN>; my @sorted = map{$_->[0]} sort {$a->[1] <=> $b->[1]} map{/chr(\d+)/;$_=[$_,$1]}@unsorted;