Anarion has asked for the wisdom of the Perl Monks concerning the following question:
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 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Commenting irrelevant code produces weirds errors
by tachyon (Chancellor) on Feb 17, 2002 at 14:52 UTC | |
by Anarion (Hermit) on Feb 17, 2002 at 15:13 UTC | |
by tachyon (Chancellor) on Feb 17, 2002 at 15:27 UTC |