Skip Menu |

This queue is for tickets about the DBIx-Simple CPAN distribution.

Report information
The Basics
Id: 18629
Status: resolved
Priority: 0/
Queue: DBIx-Simple

People
Owner: Nobody in particular
Requestors: tomitank [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.26
Fixed in: (no value)



Subject: A problem of sub abstract : lvalue
Hi Juerd, DBIx::Simple is my favorite.(What a pretty API!) But I frequently received the following errors. Can't call method "select" on an undefined value at /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. or Can't call method "update" on an undefined value at /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. or Can't call method "delete" on an undefined value at /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. or Can't call method "insert" on an undefined value at /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. Because, In this case (DBIx/Simple.pm line 209) $self->abstract->$method(@_) Want.pm say that it is not a RVALUE. I am applying this patch for myself. --- DBIx/Simple.pm.org 2006-04-10 19:19:30.000000000 +0900 +++ DBIx/Simple.pm.edit 2006-04-10 19:17:50.000000000 +0900 @@ -67,7 +67,7 @@ sub abstract : lvalue { require SQL::Abstract; - $_[0]->{abstract} ||= SQL::Abstract->new if _want('RVALUE'); + $_[0]->{abstract} ||= SQL::Abstract->new; # if _want('RVALUE'); $_[0]->{abstract} } How about this? -- Tomi
From: Venky Iyer
I'm seeing this too. This is breaking things seriously. I patched it to sub abstract : lvalue { require SQL::Abstract; # $_[0]->{abstract} ||= SQL::Abstract->new if _want('RVALUE'); # Patched by Venky $_[0]->{abstract} ||= SQL::Abstract->new if _want('LVALUE'); $_[0]->{abstract} } because it gets called as LVALUE and Want::want returns true for LVALUE. Venky On Mon Apr 10 06:38:04 2006, guest wrote: Show quoted text
> Hi Juerd, > > DBIx::Simple is my favorite.(What a pretty API!) > But I frequently received the following errors. > > Can't call method "select" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > or > Can't call method "update" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > or > Can't call method "delete" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > or > Can't call method "insert" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > > > Because, In this case (DBIx/Simple.pm line 209) > > $self->abstract->$method(@_) > > Want.pm say that it is not a RVALUE. > I am applying this patch for myself. > > > --- DBIx/Simple.pm.org 2006-04-10 19:19:30.000000000 +0900 > +++ DBIx/Simple.pm.edit 2006-04-10 19:17:50.000000000 +0900 > @@ -67,7 +67,7 @@ > > sub abstract : lvalue { > require SQL::Abstract; > - $_[0]->{abstract} ||= SQL::Abstract->new if _want('RVALUE'); > + $_[0]->{abstract} ||= SQL::Abstract->new; # if _want('RVALUE'); > $_[0]->{abstract} > } > > How about this?
From: Thomas Drugeon
Another solution is to call the abtract method once, as a rvalue, before using any SQL::Abtract method : my $dbh = DBIx::Simple->new(...); $dbh->abstract; $dbh->select(...); $dbh->insert(...); ... Le Lun. Avr. 10 06:38:04 2006, guest a écrit : Show quoted text
> Hi Juerd, > > DBIx::Simple is my favorite.(What a pretty API!) > But I frequently received the following errors. > > Can't call method "select" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > or > Can't call method "update" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > or > Can't call method "delete" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > or > Can't call method "insert" on an undefined value at > /usr/local/share/perl/5.8.4/DBIx/Simple.pm line 209. > > > Because, In this case (DBIx/Simple.pm line 209) > > $self->abstract->$method(@_) > > Want.pm say that it is not a RVALUE. > I am applying this patch for myself. > > > --- DBIx/Simple.pm.org 2006-04-10 19:19:30.000000000 +0900 > +++ DBIx/Simple.pm.edit 2006-04-10 19:17:50.000000000 +0900 > @@ -67,7 +67,7 @@ > > sub abstract : lvalue { > require SQL::Abstract; > - $_[0]->{abstract} ||= SQL::Abstract->new if _want('RVALUE'); > + $_[0]->{abstract} ||= SQL::Abstract->new; # if _want('RVALUE'); > $_[0]->{abstract} > } > > How about this?
Apparently Want.pm does not work the way I expect it to work. This means that I will need to implement the suggested change that removes Want.pm support. -- Juerd
Resolved in 1.30 -- Juerd