Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Generating Hash-of-List using map?

by moritz (Cardinal)
on Sep 23, 2013 at 16:29 UTC ( #1055329=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
        /^(.*)-(\d+)$/ and push @{ $hash{$1} }, $2
    }
    print STDERR "hash DUMPER:\n", Dumper(\%hash), "\n";
    
  2. or download this
    use v6;
    my @CELLS= 'A-1', 'A-2', 'A-3', 'A-4', 'B-5', 'B-6', 'C-7', 'C-8';
    ...
    %hash.push: @CELLS.map: *.split('-');
    
    say %hash.perl;
    
  3. or download this
    use v6;
    my @CELLS= 'A-1', 'A-2', 'A-3', 'A-4', 'B-5', 'B-6', 'C-7', 'C-8';
    ...
                     ;
    
    say %hash.perl;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-08-22 05:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (147 votes), past polls