doy++ He is completely right on this issue. I had mistakenly attributed that behavior to MXD when it is a core Perl issue. That said, the strange behaviors produced seem more subtle in a complex piece of engineering like MXD :)
On Tue, 25 Jan 2011 12:23:44 -0600 Jesse Luehrs <[email protected]> wrote: > On Tue, Jan 25, 2011 at 12:05:41PM -0600, Nick Perez wrote: > > Honestly, I feel this is an MXD bug. Florian might have a work > > around, but the real answer is for this odd behavior to be fixed. > > Not sure I agree... circular use/require things are just as much of a > problem in normal perl: > > # Foo.pm > package Foo; > use Baz; > sub quux { } > warn "Foo loaded"; > 1; > > # Bar.pm > package Bar; > use Baz; > sub quux { } > warn "Bar loaded"; > 1; > > # Baz.pm > package Baz; > require Foo; > require Bar; > warn Foo->can('quux'); > warn Bar->can('quux'); > 1; > > $ perl -MFoo -e1 > Bar loaded at Bar.pm line 4. > Warning: something's wrong at Baz.pm line 4. > CODE(0x1423730) at Baz.pm line 5. > Foo loaded at Foo.pm line 4. > > $ perl -MBar -e1 > Foo loaded at Foo.pm line 4. > CODE(0xd28730) at Baz.pm line 4. > Warning: something's wrong at Baz.pm line 5. > Bar loaded at Bar.pm line 4. > > $ perl -MBaz -e1 > Foo loaded at Foo.pm line 4. > Bar loaded at Bar.pm line 4. > CODE(0x21be4a8) at Baz.pm line 4. > CODE(0x21be700) at Baz.pm line 5. > > You really just have to be aware of how perl handles this, and avoid > having circular things to begin with. > > -doy > -- Nicholas Perez XMPP/Email: [email protected] http://search.cpan.org/~nperez/ http://github.com/nperez
