<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#! /usr/bin/perl -wT

use strict;

$ENV{PATH}="/bin:/usr/bin";

my %results=('all' =&gt; "../popcon-mail/results", 'stable' =&gt; "../popcon-mail/results.stable");
my $popbase = "../www";
my %popcon= ('all' =&gt; "", 'stable' =&gt; "/stable");
my %popfile=('all' =&gt; "all-popcon-results.gz", 'stable' =&gt; "stable-popcon-results.gz");
my %poptext=('all' =&gt; "All reports", 'stable' =&gt; "Stable reports");
my $mirrorbase = "/srv/mirrors/debian";
my $docurlbase = "/";
my %popconver=("1.28" =&gt; "sarge", "1.41" =&gt; "etch", "1.46" =&gt; "lenny", 
               "1.49" =&gt; "squeeze", "1.56" =&gt; "wheezy");
my %popver=();
my @dists=("main","contrib","non-free","non-US");
my @fields=("inst","vote","old","recent","no-files");
my %maint=();
my %list_header=(
"maint" =&gt; &lt;&lt;"EOF",
#&lt;name&gt; is the developer name;
#
#The fields below are the sum for all the packages maintained by that
#developer:
EOF
"source" =&gt; &lt;&lt;"EOF",
#&lt;name&gt; is the source package name;
#
#The fields below are the sum for all the binary packages generated by
#that source package:
EOF
"sourcemax" =&gt; &lt;&lt;"EOF");
#&lt;name&gt; is the source package name;
#
#The fields below are the maximum for all the binary packages generated by
#that source package:
EOF

# Progress indicator

sub mark
{
  print join(" ",$_[0],times),"\n";
}

# HTML templates

sub htmlheader
{
  print HTML &lt;&lt;"EOH";
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
      &lt;title&gt; Debian Popularity Contest &lt;/title&gt;
        &lt;link rev="made" href="mailto:ballombe\@debian.org"&gt;
        &lt;link rel="shortcut icon" href="/favicon.ico"&gt;
        &lt;/head&gt;
        &lt;body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000"&gt;
        &lt;div align="center"&gt;
        &lt;a href="http://www.debian.org/"&gt;
        &lt;img src="http://www.debian.org/logos/openlogo-nd-50.png" border="0" hspace="0" vspace="0" alt="" width="50" height="61"&gt;
        &lt;/a&gt;
        &lt;a href="http://www.debian.org/"&gt;
        &lt;img src="http://www.debian.org/Pics/debian.jpg" border="0" hspace="0" vspace="0" alt="Debian Project" width="179" height="61"&gt;
        &lt;/a&gt;
        &lt;/div&gt;
        &lt;br&gt;
        &lt;table bgcolor="#DF0451" border="0" width="100%" cellpadding="0" cellspacing="0" summary=""&gt;
        &lt;tr&gt;
        &lt;td valign="top"&gt;
        &lt;img src="http://www.debian.org/Pics/red-upperleft.png" align="left" border="0" hspace="0" vspace="0" alt="" width="15" height="16"&gt;
        &lt;/td&gt;
        &lt;td rowspan="2" align="center"&gt;
        &lt;font color="#FFFF00"&gt;&lt;big&gt;&lt;big&gt;Debian Popularity Contest&lt;/big&gt;&lt;/big&gt;&lt;/font&gt;
        &lt;/td&gt;
        &lt;td valign="top"&gt;
        &lt;img src="http://www.debian.org/Pics/red-upperright.png" align="right" border="0" hspace="0" vspace="0" alt="" width="16" height="16"&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td valign="bottom"&gt;
        &lt;img src="http://www.debian.org/Pics/red-lowerleft.png" align="left" border="0" hspace="0" vspace="0" alt="" width="16" height="16"&gt;
        &lt;/td&gt;
        &lt;td valign="bottom"&gt;
        &lt;img src="http://www.debian.org/Pics/red-lowerright.png" align="right" border="0" hspace="0" vspace="0" alt="" width="15" height="16"&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
EOH
}

sub popconintro
{
  my ($name,$page) = @_;
  &amp;htmlheader;
  print HTML &lt;&lt;"EOF";
  &lt;p&gt; &lt;em&gt; The popularity contest project is an attempt to map the usage of
  Debian packages.  This site publishes the statistics gathered from report
  sent by users of the &lt;a
  href="http://packages.debian.org/popularity-contest"&gt;popularity-contest&lt;/a&gt;
  package. This package sends every week the list of packages installed and the
  access time of relevant files to the server via email. Every day the server
  anonymizes the result and publishes this survey.
  For more information, read the &lt;a href="${docurlbase}README"&gt;README&lt;/a&gt; and the 
  &lt;a href="${docurlbase}FAQ"&gt;FAQ&lt;/a&gt;.
  &lt;/em&gt; &lt;p&gt;
&lt;form method="GET" action="http://qa.debian.org/popcon.php"&gt;Popcon statistics
for source package &lt;input type="text" size="30" maxlength="80" name="package"&gt;
&lt;input type="submit" value="Go"&gt;
&lt;/form&gt; &lt;p&gt;

&lt;style type="text/css"&gt;
  #tabs ul { padding: 0; margin: 0; background #DF0451; }
  #tabs li {
    display: inline;
    border: 2px #DF0451 solid;
    border-bottom-width: 0;
    margin: 0 2px 0 0;
    font-size: 140%;
    padding: 0 2px;
    -moz-border-radius: 15px 15px 0 0; border-radius: 15px 15px 0 0;
  }
  #tabs #current { background: #DF0451; color: #FFFF00; }
  #main { border: 2px #DF0451 solid; 
  -moz-border-radius: 0 15px 15px 15px; border-radius: 0 15px 15px 15px; }
&lt;/style&gt;
&lt;div id="tabs"&gt;
  &lt;ul&gt;
EOF
  for (keys %poptext)
  {
    if ($_ eq $name) {
      print HTML "&lt;li id=\"current\"&gt;$poptext{$_}&lt;/li&gt;\n";
    } else {
      print HTML "&lt;li&gt;&lt;a href=\"$popcon{$_}/$page\"&gt;$poptext{$_}&lt;/a&gt;&lt;/li&gt;\n";
    }
  }
  print HTML &lt;&lt;"EOF";
  &lt;/ul&gt;
&lt;/div&gt;
&lt;div id="main"&gt;
EOF
}

sub htmlfooter
{
  my ($numsub) = @_;
  my $date=gmtime();
  print HTML &lt;&lt;EOF;
&lt;pre&gt;
inst     : number of people who installed this package;
vote     : number of people who use this package regularly;
old      : number of people who installed, but don't use this package regularly;
recent   : number of people who upgraded this package recently;
no-files : number of people whose entry didn't contain enough information (atime
and ctime were 0).
&lt;/pre&gt;
&lt;p&gt;
Number of submissions considered: $numsub
&lt;/p&gt;&lt;p&gt;
To participate in this survey, install the &lt;a href="http://packages.debian.org/popularity-contest"&gt;popularity-contest&lt;/a&gt; package.
&lt;/p&gt;
EOF
  print HTML &lt;&lt;EOH
&lt;p&gt;
&lt;/div&gt;
&lt;small&gt;
Made by &lt;a href="mailto:ballombe\@debian.org"&gt; Bill Allombert &lt;/a&gt;. Last generated on $date UTC. &lt;br&gt;
&lt;a href="http://popcon.alioth.debian.org" &gt; Popularity-contest project &lt;/a&gt; by Avery Pennarun, Bill Allombert and Petter Reinholdtsen.
&lt;BR&gt;
Copyright (C) 2004-2005 &lt;A HREF="http://www.spi-inc.org/"&gt;SPI&lt;/A&gt;;
See &lt;A HREF="http://www.debian.org/license"&gt;license terms&lt;/A&gt;.
&lt;/small&gt;
&lt;/body&gt;
&lt;/html&gt;
EOH
}

# Report generators

sub make_sec
{
  my $sec="$_[0]/$_[1]";
  -d $sec || system("mkdir","-p","$sec");
}

sub print_by
{
   my ($dir,$f)=@_;
   print HTML ("&lt;a href=\"$dir/by_$f\"&gt;$f&lt;/a&gt; [&lt;a href=\"$dir/by_$f.gz\"&gt;gz&lt;/a&gt;] ");
}

sub make_by
{
  my ($popcon,$sec,$order,$pkg,$winner,$listp) = @_;
  my (%sum, $me);
  my @list = sort {$pkg-&gt;{$b}-&gt;{$order}&lt;=&gt; $pkg-&gt;{$a}-&gt;{$order} || $a cmp $b } @{$listp};
  $winner-&gt;{"$sec/$order"}=$list[0];
  open DAT , "|-:utf8", "tee $popcon/$sec/by_$order | gzip -c &gt; $popcon/$sec/by_$order.gz";
  if (defined($list_header{$sec}))
  {
    print DAT $list_header{$sec};
    $me="";
  }
  else 
  {
    print DAT &lt;&lt;"EOF";
#Format
#   
#&lt;name&gt; is the package name;
EOF
    $me="(maintainer)";
  }
  print DAT &lt;&lt; "EOF";
#&lt;inst&gt; is the number of people who installed this package;
#&lt;vote&gt; is the number of people who use this package regularly;
#&lt;old&gt; is the number of people who installed, but don't use this package
#      regularly;
#&lt;recent&gt; is the number of people who upgraded this package recently;
#&lt;no-files&gt; is the number of people whose entry didn't contain enough
#           information (atime and ctime were 0).
#rank name                            inst  vote   old recent no-files $me
EOF
  my $format="%-5d %-30s".(" %5d"x($#fields+1))." %-32s\n";
  my $rank=0;
  my $p;
  for $p (@list)
  {
    $rank++;
    my $m=(defined($list_header{$sec})?"":"($maint{$p})");
    printf  DAT $format, $rank, $p, (map {$pkg-&gt;{$p}-&gt;{$_}} @fields), $m;
    $sum{$_}+=$pkg-&gt;{$p}-&gt;{$_} for (@fields);
  }
  print  DAT '-'x66,"\n";
  printf DAT $format, $rank, "Total", map {defined($sum{$_})?$sum{$_}:0} @fields, "";
  close DAT;
}

sub make
{
  my ($popcon, $sec,$pkg,$winner,$list)=@_;
  make_sec ($popcon,$sec);
  make_by ($popcon, $sec, $_, $pkg, $winner, $list) for (@fields);
}
sub print_pkg
{
  my ($pkg)=@_;
  return unless (defined($pkg));
  my $size=length $pkg;
  my $pkgt=substr($pkg,0,20);
  print HTML "&lt;a href=\"http://packages.debian.org/$pkg\"&gt;$pkgt&lt;/a&gt; ",
  ' 'x(20-$size);
}

my %section=();
my %source=();

#Format
#&lt;name&gt; &lt;vote&gt; &lt;old&gt; &lt;recent&gt; &lt;no-files&gt;
#   
#&lt;name&gt; is the package name;
#&lt;vote&gt; is the number of people who use this package regularly;
#&lt;old&gt; is the number of people who installed, but don't use this package
#        regularly;
#&lt;recent&gt; is the number of people who upgraded this package recently;
#&lt;no-files&gt; is the number of people whose entry didn't contain enough
#        information (atime and ctime were 0).

sub read_result
{
  my ($name) = @_;
  my $results = $results{$name};
  my (%pkg,%maintpkg,%sourcepkg,%sourcemax,%arch,$numsub,%release);
  open PKG, "&lt;:utf8","$results" or die "$results not found";
  while(&lt;PKG&gt;)
  {
    my ($type,@values)=split(" ");
    if ($type eq "Package:")
    {
          my @votes = @values;
          my $name = shift @votes;
          unshift @votes,$votes[0]+$votes[1]+$votes[2]+$votes[3];
            $section{$name}='unknown' unless (defined($section{$name}));
            $maint{$name}='Not in sid' unless (defined($maint{$name}));
            $source{$name}='Not in sid' unless (defined($source{$name}));
            for(my $i=0;$i&lt;=$#fields;$i++)
            {
                    my ($f,$v)=($fields[$i],$votes[$i]);
                    $pkg{$name}-&gt;{$f}=$v;
                    $maintpkg{$maint{$name}}-&gt;{$f}+=$v;
                    $sourcepkg{$source{$name}}-&gt;{$f}+=$v;
                    my($sm)=$sourcemax{$source{$name}}-&gt;{$f};
                    $sourcemax{$source{$name}}-&gt;{$f}=$v 
                      if (!defined($sm) || $sm &lt; $v);
            }
    }
    elsif ($type eq "Architecture:")
    {
      my ($a,$nb)=@values;
      $arch{$a}=$nb;
    }
    elsif ($type eq "Submissions:")
    {
      ($numsub)=@values;
    }
    elsif ($type eq "Release:")
    {
      my ($a,$nb)=@values;
      $release{$a}=$nb;
    }
  }
  close PKG;
  return {'name'      =&gt; $name,
          'pkg'       =&gt; \%pkg,
          'maintpkg'  =&gt; \%maintpkg,
          'sourcepkg' =&gt; \%sourcepkg,
          'sourcemax' =&gt; \%sourcemax,
          'arch'      =&gt; \%arch,
          'release'   =&gt; \%release,
          'numsub'    =&gt; $numsub};
}

sub gen_sections
{
  my ($stat) = @_;
  my $name = $stat-&gt;{'name'};
  my %pkg = %{$stat-&gt;{'pkg'}};
  my %maintpkg = %{$stat-&gt;{'maintpkg'}};
  my %sourcepkg = %{$stat-&gt;{'sourcepkg'}};
  my %sourcemax = %{$stat-&gt;{'sourcemax'}};
  my %arch = %{$stat-&gt;{'arch'}};
  my %release = %{$stat-&gt;{'release'}};
  my $numsub = $stat-&gt;{'numsub'};
  my $popcon = "$popbase$popcon{$name}";
  my $popfile = $popfile{$name};
  my @pkgs=sort keys %pkg;
  my %sections = map {$section{$_} =&gt; 1} keys %section;
  my @sections = sort keys %sections;
  my @maints= sort keys %maintpkg;
  my @sources= sort keys %sourcepkg;
  my %winner = ();
  my ($sec, $dir, $f);
  for $sec (@sections)
  {
    my @list = grep {$section{$_} eq $sec} @pkgs;
    make ($popcon, $sec, \%pkg, \%winner, \@list);
  }
  #There is a hack: '.' is both the current directory and
  #the catchall regexp.
  for $sec (".",@dists)
  {
    my @list = grep {$section{$_} =~ /^$sec/ } @pkgs;
    make ($popcon, $sec, \%pkg, \%winner, \@list);
  }
  make ($popcon, "maint", \%maintpkg, \%winner, \@maints);
  make ($popcon, "source", \%sourcepkg, \%winner, \@sources);
  make ($popcon, "sourcemax", \%sourcemax, \%winner, \@sources);

  for $sec (@dists)
  {
    open HTML , "&gt;:utf8", "$popcon/$sec/index.html";
    opendir SEC,"$popcon/$sec";
    popconintro($name,"$sec/index.html");
    printf HTML ("&lt;p&gt;Statistics for the section %-16s sorted by fields: ",$sec);
    print_by (".",$_) for (@fields);
    print HTML ("\n &lt;/p&gt; \n");
    printf HTML ("&lt;p&gt; &lt;a href=\"first.html\"&gt; First packages in subsections for each fields &lt;/a&gt;\n");
    printf HTML ("&lt;p&gt;Statistics for subsections sorted by fields\n &lt;pre&gt;\n");
    for $dir (sort readdir SEC)
    {
      -d "$popcon/$sec/$dir" or next;
      $dir !~ /^\./ or next;
      printf HTML ("%-16s : ",$dir);
      print_by ($dir,$_) for (@fields);
      print HTML ("\n");
    }
    print HTML ("\n &lt;/pre&gt;\n");
    htmlfooter $numsub;
    closedir SEC;
    close HTML;
  }
  for $sec (@dists)
  {
    open HTML , "&gt;:utf8", "$popcon/$sec/first.html";
    opendir SEC,"$popcon/$sec";
    popconintro($name,"$sec/first.html");
    printf HTML ("&lt;p&gt;First package in section %-16s for fields: ",$sec);
    for $f (@fields)
    {
            print_pkg $winner{"$sec/$f"};
    }
    print HTML ("\n &lt;/p&gt; \n");
    printf HTML ("&lt;p&gt; &lt;a href=\"index.html\"&gt; Statistics by subsections sorted by fields &lt;/a&gt;\n");
    printf HTML ("&lt;p&gt;First package in subsections for fields\n &lt;pre&gt;\n");
    printf HTML ("%-16s : ","subsection");
    for $f (@fields)
    {
            printf HTML ("%-20s ",$f);
    }
    print HTML ("\n","_"x120,"\n");
    for $dir (sort readdir SEC)
    {
            -d "$popcon/$sec/$dir" or next;
            $dir !~ /^\./ or next;
            printf HTML ("%-16s : ",$dir);
            for $f (@fields)
            {
                    print_pkg $winner{"$sec/$dir/$f"};
            }
            print HTML ("\n");
    }
    print HTML ("\n &lt;/pre&gt;\n");
    htmlfooter $numsub;
    closedir SEC;
    close HTML;
  }
  open HTML , "&gt;:utf8", "$popcon/index.html";
  popconintro($name,"index.html");
  printf HTML ("&lt;p&gt;Statistics for the whole archive sorted by fields: &lt;pre&gt;");
  print_by (".",$_) for (@fields);
  print HTML ("&lt;/pre&gt;\n &lt;/p&gt; \n");
  printf HTML ("&lt;p&gt;Statistics by maintainers sorted by fields: &lt;pre&gt;");
  print_by ("maint",$_) for (@fields);
  print HTML ("&lt;/pre&gt;\n &lt;/p&gt; \n");
  printf HTML ("&lt;p&gt;Statistics by source packages (sum) sorted by fields: &lt;pre&gt;");
  print_by ("source",$_) for (@fields);
  print HTML ("&lt;/pre&gt;\n &lt;/p&gt; \n");
  printf HTML ("&lt;p&gt;Statistics by source packages (max) sorted by fields: &lt;pre&gt;");
  print_by ("sourcemax",$_) for (@fields);
  print HTML ("&lt;/pre&gt;\n &lt;/p&gt; \n");
  printf HTML ("&lt;p&gt;Statistics for sections sorted by fields\n &lt;pre&gt;\n");
  for $dir ("main","contrib","non-free","non-US","unknown")
  {
    -d "$popcon/$dir" or next;
    $dir !~ /^\./ or next;
    if ($dir eq "unknown")
    {
      printf HTML ("%-16s : ",$dir);
    }
    else
    {
      printf HTML ("&lt;a href=\"$dir/index.html\"&gt;%-16s&lt;/a&gt; : ",$dir);
    }
    print_by ($dir,$_) for (@fields);
    print HTML ("\n");
  }
  print HTML  &lt;&lt;'EOF';
&lt;/pre&gt;
&lt;table border="0" cellpadding="5" cellspacing="0" width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;
Statistics per Debian architectures:
&lt;pre&gt;
EOF
    for $f (grep { $_ ne 'unknown' } sort keys %arch)
    {
      my ($port)=split('-',$f);
      $port="$port/";
      $port="kfreebsd-gnu/" if ($port eq "kfreebsd/");
      printf HTML "&lt;a href=\"http://www.debian.org/ports/$port\"&gt;%-16s&lt;/a&gt; : %-10s &lt;a href=\"stat/sub-$f.png\"&gt;graph&lt;/a&gt;\n",$f,$arch{$f};
    }
  if (defined $arch{"unknown"}) {
    printf HTML "%-16s : %-10s &lt;a href=\"stat/sub-unknown.png\"&gt;graph&lt;/a&gt;\n","unknown",$arch{"unknown"}
  }
  print HTML "&lt;/pre&gt;&lt;/td&gt;\n";
  print HTML  &lt;&lt;'EOF';
&lt;td&gt;
&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;
    &lt;img alt="Graph of number of submissions per architectures"
    width="600" height="400" src="stat/submission.png"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
    &lt;img alt="Graph of number of submissions per architectures (last 12 months)"
    width="600" height="400" src="stat/submission-1year.png"&gt;
  &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
EOF
  print HTML  &lt;&lt;'EOF';
&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;
Statistics per popularity-contest releases:
&lt;pre&gt;
EOF
    for $f (grep { $_ ne 'unknown' } sort keys %release)
    {
      my($name) = $f;
      $name = "$f ($popconver{$f})" if (defined($popconver{$f}));
      printf HTML "%-25s : %-10s \n",$name,$release{$f};
    }
  if (defined $release{"unknown"}) {
    printf HTML "%-25s : %-10s \n","unknown",$release{"unknown"};
  }
  print HTML "&lt;/pre&gt;&lt;/td&gt;\n";
  print HTML  &lt;&lt;'EOF';
&lt;td&gt;
  &lt;table&gt;
    &lt;tr&gt;&lt;td&gt;
      &lt;img alt="Graph of popularity-contest versions in use"
       width="600" height="400" src="stat/release.png"&gt;
    &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;
      &lt;img alt="Graph of popularity-contest versions in use (12 last months)"
       width="600" height="400" src="stat/release-1year.png"&gt;
    &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
&lt;/td&gt;
EOF
  print HTML "&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;\n";
  print HTML "&lt;a href=\"$popfile\"&gt;Raw popularity-contest results&lt;/a&gt;\n";
  htmlfooter $numsub;
  close HTML;
}

sub read_packages
{
  my ($file,$dist);
  for $file ("slink","slink-nonUS","potato","potato-nonUS",
      "woody","woody-nonUS", values %popconver)
  {
    open AVAIL, "&lt;:utf8", "$file.sections" or die "Cannot open $file.sections";
    while(&lt;AVAIL&gt;)
    {
      my ($p,$sec)=split(' ');
      defined($sec) or last;
      chomp $sec;
      $sec =~ m{^(non-US|contrib|non-free)/} or $sec="main/$sec";
      $section{$p}=$sec;
      $maint{$p}="Not in sid";
      $source{$p}="Not in sid";
    }
    close AVAIL;
  }
  mark "Reading legacy packages...";
  for $dist ("stable", "testing", "unstable")
  {
    for (glob("$mirrorbase/dists/$dist/*/binary-*/Packages.gz"))
    {
      /([^[:space:]]+)/ or die("incorrect package name");
      my $file = $1;#Untaint
        open AVAIL, "-|:encoding(UTF-8)","zcat $file";
      my $p;
      while(&lt;AVAIL&gt;)
      {
        /^Package: (.+)/  and do {$p=$1;$maint{$p}="bug";$source{$p}=$p;next;};
        /^Version: (.+)/ &amp;&amp; $p eq "popularity-contest" 
          and do { $popver{$dist}=$1; next;};
        /^Maintainer: ([^()]+) (\(.+\) )*&lt;.+&gt;/
          and do { $maint{$p}=join(' ',map{ucfirst($_)} split(' ',lc $1));next;};
        /^Source: (\S+)/ and do { $source{$p}=$1;next;};
        /^Section: (.+)/ or next;
        my $sec = $1;
        $sec =~ m{^(non-US|contrib|non-free)/} or $sec="main/$sec";
        $section{$p}=$sec;
      }
      close AVAIL;
    }
  }
  mark "Reading current packages...";
  for $dist ("stable", "testing", "unstable")
  {
    my($v)=$popver{$dist};
    $popconver{$v}=defined($popconver{$v})?"$popconver{$v}/$dist":$dist;
  }
}

# Main code

read_packages();

mark "Reading packages...";

my %stat = ('all' =&gt; read_result('all'),
            'stable' =&gt; read_result('stable'));

mark "Reading stats...";

for (keys %stat)
{
  gen_sections($stat{$_});
}

mark "Building pages";
</pre></body></html>