I'm not an expert on those index implementations but the website lists limitations: https://www.postgresql.org/docs/9.2/static/spgist-implementation.html
Like expected it seems to implement a quadtree to narrow down possible candidates.
This would have been my first choice for a pure Perl solution.
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice