in reply to RE: Re: Object Troubles (CMonster: Wrong Way new?)
in thread Object Troubles

It depends on at least two things. First (and most important), that the interpreter knows about the existence of that class before you make that call. Otherwise, the program could die with an 'unquoted bareword' error. That doesn't sound too bad, until you get a few thousand lines in your program and don't remember what gets defined where. Ack.

The second is a little more obscure, but equally mysterious. Suppose you have an overloaded method somewhere, and you use the indirect syntax (verb object, not object->verb) to call it. What happens if there's a namespace collision? Perl will try for the main::method_name() first, and that'll probably break things.

Yes, you can program for a long time before running into those kinds of errors, but when you do, you'll wish you'd listened. :)

  • Comment on (chromatic) RE: RE: Re: Object Troubles (CMonster: Wrong Way new?)