I have an array(@pssm_list
) which contains files like this
1.nr.pssm
2.nr.pssm
3.nr.pssm
4.nr.pssm
5.nr.pssm
6.nr.pssm
7.nr.pssm
the name of file list is 1.nr.pssm
to 226.nr.pssm
I try to use sort(@pssm_list)
, but the order is not from 1 to 226
so I try to write the code like this
opendir(pssm_handle,$ARGV[0]);
@pssm_list = grep(/\.pssm/,readdir(pssm_handle));
$tag = 0;
until($tag > 226)
{
foreach $file (@pssm_list)
{
@Temp = split("[.]",$file);
if($Temp[0] == $tag)
{
push(@Sorted,join("",$file));
}
}
$tag++;
}
I want to know does there exists any solution can sort the list in one line?