in reply to Is it legal to create subs in a module?

Subroutines are created within the package's namespace. An object is simply an reference that can call subroutines (methods) in that namespace. Doing anything to the object doesn't affect the namespace.

What you want to do is something like:

{ no strict 'refs' eval "sub $action { my \$pkg = shift; return(\$pkg->{\"$action\"}) +; }" unless defined &{$action}; }
In fact, you should be doing that anyways. What you have right now won't allow you to create two objects at once or even override the default accessors. :-)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.