in reply to Trying to solve N-Queens

Sounds like it might be an application for TheDamian's module DFA::Cellular

Incidentally, search.cpan.org does not find this module.