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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://510234]
Approved by ww
Front-paged by friedo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-23 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found