1

when I try to run this .pl script:

\#!/usr/bin/perl

use strict;

use abc::abcBill;
use abc::abcBill::Manager;

abc::abcBill::Manager->update_abcBill(
 set => {  mb_status=>'Purged' },
 where=>[  mb_created_date => { ls => '2012-05-01 00:00:00' } ],
 debug =>1
);

The error I get is:

Can't locate object method "update_abcBill" via package "abc::abcBill::Manager"

I have checked my abcBill::Manager, and I have a make_manager method there, but it just wont compile the .pl script.

Community
  • 1
  • 1
rsharma
  • 75
  • 1
  • 9
  • 1
    It says that it cannot find the `update_abcBill` method. There's no mention of a `make_manager` method. Also, you might want to add `use warnings` to that script for good measure as it tells you about subtle mistakes. – simbabque Nov 01 '12 at 16:48
  • Another thing: you are calling a class method that seems to do stuff to an object. Where is that object? You didn't create one already. Maybe there's something wrong with your logic. – simbabque Nov 01 '12 at 16:50
  • We'd have to see abc::abcBill::Manager. – Schwern Nov 01 '12 at 17:10
  • 1
    @simbabque: that's quite alright. The Rose::DB "Manager" class for a particular type is the thing that does stuff on a table. That update call is supposed to be mapped to an SQL call like `UPDATE abcBill SET mb_status = 'Purged' WHERE mb_created_date < '...'`. Why it doesn't work depends on how the `make_manager` method is actually called. If it's something like `__PACKAGE__->make_manager_methods('abcBill');` then `update_abcBill` should work being called on the package. @Schwern is right, we need to see `abc::abcBill::Manager` (and/or `abc::abcBill`). – Moritz Bunkus Nov 01 '12 at 17:15
  • package abc::abcBill::Manager; use strict; use base qw(Rose::DB::Object::Manager); use abc::abcBill; sub object_class { 'abc::abcBill' } __PACKAGE__->make_manager_methods('abcBill'); – rsharma Nov 09 '12 at 01:50
  • thats how i defined my Manger for abcBill – rsharma Nov 09 '12 at 01:50

0 Answers0