in reply to I need help

map {$a[int(rand(6) + 1)]++} 0 .. 5999;
$a[int(rand(6) + 1)]++} for 0 .. 5999; print "side $_: $a[$_]\n" for 1..6;

Replies are listed 'Best First'.
Re^2: I need help
by Kenosis (Priest) on Mar 12, 2014 at 05:34 UTC

    This is well done, but consider instead:

    $a[int(rand(6) + 1)]++ for 0 .. 5999;

    to avoid using map in a void context, as map may be considered a kind of functor.

      yes, thank you sir.
      got carried away