in reply to Re: Sub on the fly?
in thread Sub on the fly?

Well to start with, perl's method dispatch will first look for an inherited method, then go to AUTOLOAD, so if the OP wants to override a method locally they could not do this with AUTOLOAD.

Also, using AUTOLOAD has a signifigant performance hit, which depending on the complexity of your AUTOLOAD function can easily be something like 4x slower. Not to mention the programmer complexity hit, even the simplest AUTOLOAD function is harder to understand and reason about then a set of simple methods.

IMO, AUTOLOAD should be a last resort for when you really don't know the names of the methods to be called, and not a tool for reducing typing.

-stvn