Quantum-Superpositions reviews

RSS | Module Info

Quantum::Superpositions / Quantum-Superpositions (2.02) *****

While Quantum::Superpositions might take a little getting used to, it's swiftly become one of the oft-used weapons in my arsenal, as it lets me get around writing horrible spaghetti nested loops of code in many instances. Instead I can turn out code that looks much more Perl-ish, and in fact this module should be part and parcel of Perl 6 if I've read things correctly.

use warnings; use strict;

my @Array1 = qw(cat dog mouse rat);
my @Array2 = qw(mouse bird rat snake);

use Quantum::Superpositions;

my @notinarray1 = map { $_ }

eigenstates( any(@Array2) ne all(@Array1) );
my @notinarray2 = map { $_ }

eigenstates( any(@Array1) ne all(@Array2) );

print "@notinarray1: not found in Array 1\n",

"@notinarray2: not found in Array 2\n";

Look Ma! No nested loops!