Perl When is using AUTOLOAD OK?
- by Robert S. Barnes
In "Perl Best Practices" the very first line in the section on AUTOLOAD is:
Don't use AUTOLOAD
However all the cases he describes are dealing with OO or Modules.
I have a stand alone script in which some command line switches control which versions of particular functions get defined. Now I know I could just take the conditionals and the evals and stick them naked at the top of my file before everything else, but I find it convenient and cleaner to put them in AUTOLOAD at the end of the file.
Is this bad practice / style? If you think so why, and is there a another way to do it?