(Direct copy&paste from the perldoc)Changing Your Column Accessor Method Names accessor_name / mutator_name If you want to change the name of your accessors, you need to provide an accessor_name() method, which will convert a column name to a method name. e.g: if your local naming convention was to prepend the word 'customer' to each column in the 'customer' table, so that you had the columns 'customerid', 'customername' and 'customerage', you would end up with code filled with calls to $customer->customerid, $customer->customername, $customer->customerage etc. By creating an accessor_name method like: sub accessor_name { my ($class, $column) = @_; $column =~ s/^customer//; return $column; } Your methods would now be the simpler $customer->id, $cusĀ tomer->name and $customer->age etc.
Is that what you were looking for?
C.
In reply to Re: Class::DBI, reblessing and primary key names
by castaway
in thread Class::DBI, reblessing and primary key names
by glwtta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |