in reply to Re: Re: Re: Re: Can't call method "prepare" on an undefined value
in thread Can't call method "prepare" on an undefined value

  1. As per the Camel Book (3 ed.) p. 994 the local operator is used to localize a global variable within a dynamic scope.

    Use my for local variables whenever you can get away with it. Using local merely gives you a temporary value to a global variable. (the Camel Book (3 ed.) p. 588)

  2. Did you declare $mwsdbh also as a local initially? If you leave the scope it was declared in, it looses its local value.

  3. You can pass anything out to a subroutine: scalars, arrays, hashes, references, ...

    As long as the subroutine reads it back in through @_ in the right order it cannot be the cause of your problem. Can you post your code with the passing of the $mwsdbh variable to the subroutine and the way the subroutine used it?

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Re: Re: Re: Re: Can't call method "prepare" on an undefined value