Next Program Repair Shop 183

Higher-Order Functions

        do_with_board(sub {
          if ($move eq "$_[0]$_[1]") {
             $squares->[$_[0]][$_[1]] = "x";   ## define array element for choice
          }
        });
        sub do_with_board(&) { ... }
        do_with_board {
          if ($move eq "$_[0]$_[1]") {
             $squares->[$_[0]][$_[1]] = "x";   ## define array element for choice
          }
        };


Next Copyright © 2002 M. J. Dominus