Simple Class::DBI issue

Simple Class::DBI issue

am 10.01.2007 21:17:51 von Tim Bolshaw

--===============0794531892==
Content-Type: multipart/alternative;
boundary="----=_Part_8764_19708493.1168460271930"

------=_Part_8764_19708493.1168460271930
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I sincerely apologise for posting such a simple issue, but (presumably as a
result of premature senility or insufficient sleep) I cannot see the
solution to this simple problem:

use strict;
use warnings;

package Trendex::MyDBI;
use base 'Class::DBI::mysql';
{
__PACKAGE__->set_db('Main', 'dbi:mysql:test', 'user', 'pswd',
{AutoCommit=>0});
}
package Trendex::Consumer;
use base 'Trendex::MyDBI';
{
__PACKAGE__->set_up_table('Consumer');
}
package showError;
use base 'Trendex::Consumer';
{
__PACKAGE__->set( LASTNAME => 'Smith' );
}

results in the error

Can't use string ("showError") as a HASH ref while "strict refs" in use at
E:/Perl/site/lib/Class/DBI.pm line 466

(This is Class::DBI 3.0.14 and the line that triggers the error is
for my $col (keys %$vals) { $self->{__Changed}{$col}++; } )

What is the simple solution?

------=_Part_8764_19708493.1168460271930
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I sincerely apologise for posting such a simple issue, but (presumably as a result of premature senility or insufficient sleep) I cannot see the solution to this simple problem:

use strict;
use warnings;

package Trendex::MyDBI;

use base 'Class::DBI::mysql';
{
    __PACKAGE__->set_db('Main', 'dbi:mysql:test', 'user', 'pswd', {AutoCommit=>0});
}
package Trendex::Consumer;
use base 'Trendex::MyDBI';

{
    __PACKAGE__->set_up_table('Consumer');
}
package showError;
use base 'Trendex::Consumer';
{
    __PACKAGE__->set( LASTNAME => 'Smith' );
}

results in the error


Can't use string ("showError") as a HASH ref while "strict refs" in use at E:/Perl/site/lib/Class/DBI.pm line 466

(This is Class::DBI 3.0.14 and the line that triggers the error is

    for my $col (keys %$vals) { $self->{__Changed}{$col}++; } )

What is the simple solution?


------=_Part_8764_19708493.1168460271930--

--===============0794531892==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0794531892==--