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

Here's my connect and disconnect procedures.. the %MWSPARAM hash gets populated with the necessary database information.

sub mwsconnect { use DBI; local $server = $MWSPARAM{server}; local $db = $MWSPARAM{db}; local $user = $MWSPARAM{user}; local $passwd = $MWSPARAM{passwd}; #========================================== #make the connection #========================================== $mwsdbh = DBI->connect("DBI:mysqlPP:database=$db;host=$server" +, $user, $passwd) or &mwserror("DB Error: " . $DBI::errstr); } sub mwsdisconnect { $mwsdbh->disconnect(); }

...

Thanks!

#!/massyn.pl The more I learn, the more I realize I don't know. Albert Einstein 1879-1955

Replies are listed 'Best First'.
Re: Re: Re: Can't call method "prepare" on an undefined value
by Massyn (Hermit) on Dec 19, 2002 at 06:12 UTC

    #!/fellow/monks.pl

    I believe I found the problem... It's a bug in perl...

    Thanks!

    #!/massyn.pl The more I learn, the more I realize I don't know. Albert Einstein 1879-1955

      I believe I found the problem... It's a bug in perl...

      I don't think that bug report has anything to do with your problem, unless you're using DESTROY methods and/or END blocks. If you were calling any of these subs from an END or DESTROY block, I would think (or hope) that you would have mentioned it. I think the problem is still that either you are not connecting to the database and don't realize it, or your database handle does not have the scope you think it does (or your calling the routines from an END or DESTROY block). We still haven't seen enough code to determine either.

      Im with the same problem can you help me?