Next Program Repair Shop 145

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 © 2002 M. J. Dominus