Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: syntax error with map in list context

by pg (Canon)
on Nov 20, 2005 at 17:26 UTC ( #510256=note: print w/ replies, xml ) Need Help??


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 );


Comment on Re: syntax error with map in list context
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://510256]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-12-25 13:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls