package ChatBot; use base qw/Class::Bundle/; use ChatBot::Config; use ChatBot::Brain; use ChatBot::Logger; # exports logger() ... use Net::OSCAR; sub new { my($class, $name) = @_; my $self = bless { config => ChatBot::Config->new , brain => ChatBot::Brain->new , ... , oscar => Net::OSCAR->new } => ref($class) || $class; $self->bundle($name); # note 1) $self->inject('logger'); # note 2) }