use Quantum::Superpositions; my @a = ( 1 .. 6 ); my @b = ( 3 .. 8 ); print "$_\n" foreach eigenstates( any( @b ) != all( @a ) );