- or download this
sub current_balance {
my $self = shift;
...
}
return $self->{current_balance};
}
- or download this
has current_balance => (is => 'rw', isa => 'Num');
- or download this
package DebuggingDB;
use Moose;
...
{
before $method => sub { warn "$method was called" };
}
- or download this
package DebuggingDB;
use Moose::Role;
...
{
before $method => sub { warn "$method was called" };
}
- or download this
use Moose::Util qw/apply_all_roles/;
apply_all_roles('DB', 'DebuggingDB') if $ENV{DEBUG};
- or download this
my $accounts = DB->new(...);
my $marketing = DB->new(...);
use Moose::Util qw/apply_all_roles/;
apply_all_roles($marketing, 'DebuggingDB') if $ENV{DEBUG};