Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2016-07-25 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (224 votes). Check out past polls.