It probably will work, at least it would work as well as any other subroutine does in a Registry script. However, it seems pretty strange to me, using an auto-generated package name and subs defined within other subs when doing OO. If you want to do OO, why don't you just use a PerlHandler? It's easy and saves you from questions likes this.