Though it's Python and not Perl, and seems to take the whole thing more seriously—and, I imagine, usefully, though I'm not experienced enough to be able to judge from a glance—this post cannot go by without a mention of Damian Conway and his Quantum::Superpositions module (https://metacpan.org/pod/Quantum::Superpositions).