Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

syntax error with map in list context

by LucaPette (Friar)
on Nov 20, 2005 at 12:03 UTC ( #510234=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    ...
    } 1 .. 10;
    
    print "$_ @{$data{$_}}\n" for ( keys %data );
    
  2. or download this
    syntax error at ./mytest line 9, near "} 1"
    Execution of ./mytest aborted due to compilation errors.
    
  3. or download this
    my %data=map {
        "Player number $_", [ map { 1 + int rand(10) } 1 .. 5 ] 
    } 1 .. 10;
    
  4. or download this
    my %data=map {
        "Player number " . $_, [ map { 1 + int rand(10) } 1 .. 5 ] 
    } 1 .. 10;
    
  5. or download this
    Player number6 6 7 3 2 7
    Player number2 3 2 6 7 8
    ...
    Player number3 8 6 9 5 6
    Player number5 9 3 5 6 6
    Player number8 10 3 8 8 1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://510234]
Approved by ww
Front-paged by friedo
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2016-12-03 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (56 votes). Check out past polls.