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 );
In reply to Re: syntax error with map in list context
by pg
in thread syntax error with map in list context
by LucaPette
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |