http://www.perlmonks.org?node_id=510256


in reply to syntax error with map in list context

Another way to force Perl to take your code is to add a pair of (), which seems clean and simple to me:

use strict; my %data=map { ("Player number $_"), [ map { 1 + int rand(10) } 1 .. 5 ] } 1 .. 10; print "$_ @{$data{$_}}\n" for ( keys %data );