Bot-BasicBot-Pluggable

 view release on metacpan or  search on metacpan

lib/Bot/BasicBot/Pluggable/Store.pm  view on Meta::CPAN

use Module::Load qw();
use Log::Log4perl;

use base qw( );

sub new {
    my $class = shift;
    my $self;
    my $logger = Log::Log4perl->get_logger($class);
    if ( @_ % 2 == 0 ) {
        $self = bless {@_} => $class;
    }
    elsif ( @_ == 1 and ref $_[0] eq 'HASH' ) {
        $self = $class->new_from_hashref( $_[0] );
    }
    elsif ( @_ == 1 and !ref $_[0] ) {
        $self = $class->new_from_hashref( { type => $_[0] } );
    }
    elsif ( !@_ ) {
        $self = bless {} => $class;
    }
    else {
        $logger->warn(
"Argument to new() is neither an argument list, a hashref, a string nor empty"
        );
    }
    $self->init();
    $self->load();
    return $self;
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.014 second using v1.00-cache-1.14-grep-28634ff-cpan-ac32402124b )