in reply to Re: •Re: Method "do" error
in thread Method "do" error
I think merlyn has already provided the answer. In the store_items subroutine, simply remove this line:
my $dbh;From your description of WebDB, it seems likely that it is creating a DBI database handle object and storing it in a global variable called '$dbh'. By including 'my $dbh;' in the subroutine, you are creating a new variable with the same name that only exists within the subroutine and prevents access to the global. Because the variable in the subroutine is new, it is undefined.
Since you have 'use strict' in effect, it is possible that removing the my $dbh; line will trigger the error: Global symbol "$dbh" requires explicit package name. If that is the case, you'll need to explicitly declare that it is a global variable like this:
our $dbh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: •Re: Method "do" error
by b310 (Scribe) on Apr 20, 2003 at 20:30 UTC | |
by grep (Monsignor) on Apr 20, 2003 at 20:39 UTC | |
by grantm (Parson) on Apr 20, 2003 at 22:21 UTC |