On 11-08-28 08:15 PM, Jess Odum wrote:
I'm not exactly sure what the arguments for "AUTOLOAD considered
harmful" are, but I do believe that AUTOLOAD's use should be limited and
with responsibility.

Name collision is one reason.

<http://books.google.ca/books?id=Rl1lj794VVgC&pg=PA96&lpg=PA96&dq=object+oriented+programming+name+collision&source=bl&ots=c1Cv7lY6pc&sig=SG3X34wE5oL3040fTiELa6GEeR4&hl=en&ei=3eRaTpf5JOLf0QHjsP2TCQ&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBcQ6AEwAA#v=onepage&q=object%20oriented%20programming%20name%20collision&f=false>

If two different piece of the script ask for different subs but with the same name, one or the other will prevail and the other will get the wrong code. If you `use warnings;` and name the subs with the same name, the compiler will complain about the name collision.

$ perl -Mwarnings -e'sub foo{} sub foo{}'
Subroutine foo redefined at -e line 1.


--
Just my 0.00000002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

"Make something worthwhile."  -- Dear Hunter

Reply via email to