Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: looking for a perl way to build a hash

by choroba (Abbot)
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-12-25 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls