Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: DBIx::Class::Schema::Loader prob

by jfrm (Monk)
on Sep 06, 2006 at 13:36 UTC ( #571460=note: print w/replies, xml ) Need Help??

in reply to Re^2: DBIx::Class::Schema::Loader prob
in thread DBIx::Class::Schema::Loader prob

I think I've finally got rid of my unreferenced scalar messages thanks to some pointers from Matt Trout and others. I've tried all sorts of ways around the problem but in the end, here is a summary of my final solution for the record. Experts might wish to correct technicalities, where I've been particularly amateur...

Bottom line seems to be that the DBI that comes with Active State Perl has problems (probably to do with threading) which cause errors like this:

Attempt to free unreferenced scalar: SV 0x1fa7a5c, Perl interpreter: 0 +x224234 at C:/Perl/site/lib/SQL/Abstract/ line 325.

in a number of situations and certainly when using DBIx modules on Windows.

DBI is one of those modules that isn't just interpreted - part of it is compiled C++. A way to fix the problem is to overwrite DBI with a version that has been compiled using a different C++ compiler - recommended is gcc. gcc is the defacto standard open source C++ compiler. And, incidentally, MingW seems to be the most popular pre-compiled version of gcc and other related stuff for Windows. However, if one looks at the documentation that comes with gcc and one is not a C++ programmer, one becomes mightily scared. It appears that all sorts of stuff needs to be configured and downloaded and compiled so downloading and installing a pre-packaged C++ compiler seems a hugely attractive option by comparison. But, even with the free Microsoft C++ compiler or the free Intel C++ compiler or the free MingW C++ compiler, installation is not straightforward and for a non-C++ programmer, extremely off-putting. CamelPack Perl is an installer bundle of Active State Perl together with MingW C++ compiler and MS Nmake into a simple install package.

So first install Camel Pack Perl including the C++ stuff.

DBI comes with CamelPack Perl of course. So, if you try to install it using CPAN it will likely say "DBI is up to date." which leaves you up the creek without a paddle. So, being not easily put off, decide to do this by hand. As per the standard module installation instructions you (within CPAN) do the following:

make DBI test DBI

at which point one of the tests fails - as is often the case with Windows (one wonders if one should even bother with these tests under Windows so often do they fail). Based on this pessimistic outlook and despite the fact that you aren't really supposed to install unless all tests pass, ignore this and also override the "DBI is up to date" message by typing

force install DBI

This seems to work and, for me, at least the unreferenced scalar messages and the inconsistent behaviour instantly disappeared.

I hope this non-expert perspective helps someone in the future.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://571460]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-05-25 04:36 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (84 votes). Check out past polls.