in reply to Re: Another "Find the bug!" Node
in thread Another "Find the bug!" Node

I can't quite say for NDA reasons, but someone wrote a package, Package2, which attempted to provide all of Package1's functionality. They also added an extra subroutine, 'foobar', which could be exported. However, if something in your codebase loads Package2 and later you try to load Package1, it's already loaded and when it tries to export 'foobar', it blows up because it doesn't have it. The solution is to do a deep copy on the arrays. Otherwise, because Package2 has a reference to an array in Package1, modifying the array in Package2 modifies the same array in Package1. Does that make sense?

I know it sounds a bit convoluted, but there it is :)

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re^3: Another "Find the bug!" Node
by talexb (Chancellor) on Sep 28, 2006 at 15:03 UTC

    Yes, now that makes sense .. thanks. That might provide an interesting topic for a Meditation, about the pitfalls surounding the construction of a wrapper for a Perl module.

    Having written TSR's in both assembler and C for DOS, I understand how things can get a little mind-bendingly complicated.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds