Next Program Repair Shop 161

Try it Both Ways

        for my $rn (1..5) {
          $rounds->{"round$rn"} = 
            { player   => $page->param("round${rn}_x"),
              computer => $page->param("round${rn}_o"),
            }
        }
        $rounds = { map {("round$_" => 
                              { player   => $page->param("round${_}_x"),
                                computer => $page->param("round${_}_o"),
                              }
                          )} (1..5) };


Next Copyright © 2001 M. J. Dominus