http://www.perlmonks.org?node_id=1015912


in reply to add method at runtime

Yes, it's possible. The reasons and benefits, however, vary with the type of task you're doing.

Generally, when you find the need to do it, you'll pretty much know the advantages. At that point, you probably need to contemplate the disadvantages as well, though. ;^)

Update: Check out How can I use AUTOLOAD to magically define get and set methods for my member data? for an example.

...roboticus

When your only tool is a hammer, all problems look like your thumb.