Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Minimize Hash Key Value Combinations

by AlexTape (Monk)
on Nov 18, 2013 at 14:20 UTC ( #1063095=note: print w/replies, xml ) Need Help??


in reply to Re^3: Minimize Hash Key Value Combinations
in thread Minimize Hash Key Value Combinations

first you are right.. i made the result manually.. that was a simple mistake.. :)

actually it is an hash tree.. but i dont want to deflect the problem with code snippets..
keys are strings never arrays
i dont agree.. just take a look at Hash::Multikey or perldsc or maybe it is a nested structure like this:
#!/usr/bin/perl -w use strict; use warnings; my %hash; $hash{'number'}{'even'} = [24, 44, 38, 36]; $hash{'number'}{'odd'} = [23, 43, 37, 35]; foreach my $i(keys %hash){ print $i; foreach my $j(keys %{$hash{$i}}){ print "\t".$j."\t"; print join(" ",@{$hash{'number'}{$j}})."\n"; } }
furthermore thats offtopic :)
$perlig =~ s/pec/cep/g if 'errors expected';

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-09-29 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?