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;In reply to Re: Re: •Re: Method "do" error
by grantm
in thread Method "do" error
by b310
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |