my $num=0; for(@taulell) { $num+=grep /B/,@$_; } addstr(2,1,"B = $num"); addstr(24,3, "Y = $pos{y}"); $num=0; map { $num+=grep /B/,@$_; } @taulell; addstr(3,1,"N = $num"); addstr(24,35,"Tecla = <$key> "); #### my $num=0; #for(@taulell) #{ # $num+=grep /B/,@$_; #} addstr(2,1,"B = $num"); addstr(24,3, "Y = $pos{y}"); $num=0; map { $num+=grep /B/,@$_; } @taulell; addstr(3,1,"N = $num"); addstr(24,35,"Tecla = <$key> "); #### addstr(3,1,"N = ". scalar map { grep { /B/ } @$_ } @taulell );