やっとテスト終わったので書いておきます。
使いはる場合は、優先順位頭数は適当にいじってください。
horse3_race.cgiの最後のサブルーチンを下記に置き換え
sub syussouba_select{
my $ca_syoukin = 3; # 賞金上位優先頭数
my $ca_sentyaku = 1; # 先着順優先頭数
my $ca_koutyaku = 5; # 後着順優先頭数
my ($m , $n , $yuusen , $uma_data , $key , $kari_ra);
my @uma_data = ();my %uma_syoukin = ();my @syoukin_junjo = ();my @kari_ra = ();
$yuusen = $ca_syoukin + $ca_sentyaku + $ca_koutyaku;
if($#ra > 10 && $ca_syoukin > 0){
for ($m = 1 ; $m < $#ra + 1 ; $m++){
@uma_data = ();@uma_data = split(/<>/,$ra[$m]);
$uma_syoukin{"$m"} = $uma_data[21] + $uma_data[22];}
foreach $key (sort {$uma_syoukin{$b} <=> $uma_syoukin{$a}} keys %uma_syoukin){
push @syoukin_junjo , $key;}
splice (@syoukin_junjo , $ca_syoukin);
reverse @syoukin_junjo;
foreach $n (@syoukin_junjo){
$kari_ra = splice (@ra , $n , 1);
splice (@ra , 1 , 0 , $kari_ra);}}
if($#ra > 10 && $ca_koutyaku > 0){
@kari_ra = splice (@ra , $ca_koutyaku * -1);
splice (@ra , 1 , 0 , @kari_ra);}
@sakujo_umas = (); # グローバル変数、出走除外馬データ
my $sakujo_uma;
while($#ra > 10){
$m = $yuusen + int(rand($#ra - $yuusen)) + 1;
$sakujo_uma = splice (@ra , $m ,1);
push @sakujo_umas , $sakujo_uma;}}