Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: looking for a perl way to build a hash

by choroba (Chancellor)
on Jul 26, 2013 at 14:11 UTC ( #1046521=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    
    my %hash2 = split /,/ => "$strA,$strB";
    print Dumper \%hash2;
    
  2. or download this
    my ($strA, $strB) = ("$str1,", "$str2,");
    my %hash = map { map substr($_, 0, -1),
    ...
                   } 1 .. $strA =~ tr/,//;
    
    print Dumper \%hash;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046521]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-02-25 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (365 votes). Check out past polls.