Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Obtaining combinations of hash keys and values

by Anonymous Monk
on Apr 28, 2016 at 17:38 UTC ( #1161799=note: print w/replies, xml ) Need Help??

in reply to Obtaining combinations of hash keys and values

Why not keep the fragments as pairs. The pairs can then combine to produce four alternatives.


Or, you could keep only the F fragments, but assemble the four FF FR RF RR variants right as you combine two fragments. For example, write a sub that accepts two keys and returns four pairs as a list. Breaking down the problem into subroutines is a smart idea in any case. Using Algorithm::Combinatorics combinations() is then possible since you have one key per fragment/cognate.

Replies are listed 'Best First'.
Re^2: Obtaining combinations of hash keys and values
by Anonymous Monk on Apr 29, 2016 at 09:02 UTC
    Thank you. I had no considered passing it off to a subroutine - good excuse to learn how to use subs now!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2019-07-22 22:22 GMT
Find Nodes?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?

    Results (21 votes). Check out past polls.