Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jk2addict (4946)

  (email not shown publicly)
AOL IM: chrislaco (Add Buddy, Send Message)
Yahoo! ID: (Add User, Send Message)

Journal of jk2addict (4946)

Sunday November 27, 2005
09:51 PM


[ #27761 ]

Over the last view days of converting Handel from CDBI from DBIC, I took another look at Class::Accessor and Class::Data::Inheritable. One of the things I found myself wanting was something that did both the inheritable class data and supported instance data using the same accessor.

Well, as it turns out, Matt Trout had such a thing sitting in the repo. After some pod tweaking and slight dist preparation, Class::Data::Accessor 0.01 is coming to a CPAN mirror nearest you.

Its usage is roughly:

package Base;
use base qw/Class::Data:Accessor/;
__PACKAGE__->mk_classaccessor('AutoCommit' => 1);
print Base->AutoCommit; # prints 1
package BetterBase;
use base qw/Base/;
print BetterBase->AutoCommit; #prints 1
print BetterBase->AutoCommit; #prints 0
print Base->AutoCommit; # prints 1
my $base = BetterBase->yournew();
print $base->AutoCommit; # prints 1
print $base->AutoCommit; # prints 1

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.