Drawbacks of AUTOLOAD
Learn about the drawbacks of using AUTOLOAD.
We'll cover the following...
AUTOLOAD()
can be useful, though it’s difficult to use properly. The naïve
approach to generating methods at runtime means that the can()
method won’t
report the right information about the capabilities of objects and classes.
Easiest solution
The easiest solution is to predeclare all functions we plan to AUTOLOAD()
with the
subs
pragma:
Access this course and 1400+ top-rated courses and projects.