Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2015-11-27 17:28 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls