Fix mamer crash on listmanagers command
[capablanca.git] / lasker-2.2.3 / bots / mamer / bin / hindex.pl
1 #!/usr/local/bin/perl
2
3 $dirpath = "/home/mlong/mamer/help/";
4
5 opendir(FILELIST, "$dirpath");
6 @allfiles = readdir(FILELIST);
7 closedir(FILELIST);
8
9 open(OUT, ">$dirpath/index");
10 $i = 0;
11 $j = 0;
12 $offset = $#allfiles/4;
13 @allfiles = sort @allfiles;
14 foreach $a (@allfiles) {
15     if($allfiles[$i] !~ /\./) {
16         $temp[$j] = $allfiles[$i];
17         $j++;
18     }
19     $i++;
20 }
21 @allfiles = @temp;
22 $i = 0;
23 #print OUT "$#allfiles files listed\n";
24 while ($i <= ($#allfiles/4)) {
25     printf OUT 
26         (" %-18s %-18s %-18s %-18s\n", 
27          $allfiles[$i], $allfiles[$i+($offset*1)],
28          $allfiles[$i+($offset*2)], $allfiles[$i+($offset*3)]);
29     $i++;
30 }
31 #print OUT "\n";
32 close(OUT);