Re: Attempt to free unreferenced scalar wanings with threads
[email protected] (Elizabeth Mattijsen)
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <p05111b00bbca7de97463@[192.168.56.2]> |
At 16:17 -0800 10/31/03, Javier Alvarado wrote:
>I'm trying to make one of my programs multi-threaded using perl
>5.8.1 and threads.pm. It seems to work just fine except that when
>each thread exits (I think) it emits a warning like:
>
>Attempt to free unreferenced scalar at
>/usr/local/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi/DBI.pm
>line 628
>
>Each thread has it's own database handle, so each one prints out
>several warnings. By the time the program is done, it's printed
>hundreds of of them.
>
>I can't for the life of me figure out what it means or how to fix
>it. I've search the web and newsgroups with no avail. So at this
>point, I'm just looking for a way to disable this particular
>warning. Anyone know if it's possible?
You could try loading DBI inside the thread at runtime:
$thread = threads->new( sub {
require DBI; # can't "use" because that's compile time
requite DBD::yourdriver;
# do your database stuff;
} );
Liz