Acme-Affinity
view release on metacpan or search on metacpan
q => "What's the best concert you've ever attended?",
a => ['Black Sabbath', 'Barry Manilow', 'Wu Tang Clan'] },
{ i => 17,
q => "What's your most valuable possession?",
a => ['guitar', 'vase', 'necklace'] },
{ i => 18,
q => "Who's the most fascinating person you know?",
a => ['mom', 'dad', 'friend'] },
{ i => 19,
q => "What's the hardest thing you've ever done?",
a => ['say I love you', 'meet the in-laws'] },
{ i => 20,
q => "What's the scariest thing you've ever done?",
a => ['say I love you', 'meet the in-laws'] },
];
# Set you to a purposfully strict set of answers
my $you = [ map { [ $_->{a}[0], $_->{a}[0], 'mandatory' ] } sort { $a->{i} <=> $b->{i} } @$questions ];
my %answers = (); # Bucket for the indexed "me" answers
my $affinity = Acme::Affinity->new;
my @importance = sort { $affinity->importance->{$a} <=> $affinity->importance->{$b} } keys %{ $affinity->importance };
( run in 1.145 second using v1.01-cache-2.11-cpan-b85c58fdc1d )