Re: Roles

2009-05-06 Thread Todd Hepler
Dmitri wrote: Is there a clean way to share data from class in a role? If it was an object method I would probably set up attribute for that, but it's a class method. package FN::Utils; use Moose::Role; # class method sub some_db_op { need $TABLE from consuming class here } package FN::U

Re: Moose::Util function for applying missing roles

2009-04-14 Thread Todd Hepler
like that were to be added, I might call it ensure_roles_applied(). -- Todd Hepler Informatics -- LIMS

Re: Calling class methods from a metaclass

2008-06-13 Thread Todd Hepler
Dan Harbin wrote: The following: #!/usr/bin/env perl use strict; use warnings; package MyClass; { use Moose; sub hello_class { my $class = shift; return "Hello $class\n"; } } print "1: ", MyClass->hello_class(), "\n"; my $myc

Re: changing the default base class

2006-11-17 Thread Todd Hepler
Jonathan Swartz wrote: > > package My::Person; > use My::Moose;# automatically sets superclass to > My::Moose::Object, instead of Moose::Object I have wanted something similar, and ended up with this: package My::Moose; sub import { my $caller = caller(); eval qq{ pac