On 6/28/07, Philip Dye <[EMAIL PROTECTED]> wrote:
> Here are two classes, the first works as expected the second fails with the
> listed error message: [...]
> Can't call method "Id" on unblessed reference at
> .../Rose/DB/Object/MakeMethods/Generic.pm line 3470.
This is a Perl issue, not an RDBO issue. Example:
package A;
sub B { print "B\n" }
package A::B;
sub x { print "x\n" }
package main;
A::B->x();
If you run that, you get this error:
"Can't call method "x" without a package or object reference at ..."
One way to avoid this is to use lowercase method names, reserving
Title Case for classes only. In the example above, if package A had a
"sub b { ... }" instead of a "sub B { ... }", it'd work fine.
Quoting the class name in the last line also fixes it:
'A::B'->x();
and so, changing line 31 of regional-pricing/bug/t/3.fields.t to this:
my $price = 'Product::Price'->new( Price => 3.95, Region => 'US' ) ;
also fixes your test. But that's pretty cumbersome and ugly. Using
lowercase column names (or renaming your classes) seems like a better
solution, IMO.
-John
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object