Re: [code-review] Re: Lingua::Phonology

"Martyn J. Pearce" <[email protected]> Thu, 13 Nov 2003 18:41:13 +0000
Newsgroups gmane.comp.lang.perl.code-review-ladder
Message-ID <[email protected]>
On Thu, Nov 13, 2003 at 11:42:44AM -0600, Hodges, Paul wrote:
> > For a more annoying example, see
> > http://blog.simon-cozens.org/bryar.cgi/id_6416
> > which caught me out in one of my modules.
> 
> O Lord! And here I was thinking I knew what I was doing. How have I
> consistently missed this topic on the boards for so long? Geez, this is too
> scary!
> 
> So from the above link, what is it that is different? How the hell can order
> of definition change the behavior? This is nutz!

Because in the first example, the 'new X::Y' is compiled before Perl even saw
the existence of the X::Y package, and so had to guess at which side of the
ambiguity to reckon on.  In the second example, package X::Y had been seen, so
Perl determines that 'new X::Y' is probably an indirect object method call.

I provide this explanation by way of reasoning, not excuse :-)

Mx.