MongoDB Perl Wrapper I'm trying to create a custom "mongodb perl wrapper".
I created the following perl module, which local on my machine runs.
My questions to the community are:


Would you create the module different?
Do you have improvements or adaptations to create the module better?


Code:

package MyMongo;

use strict;
use Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
use MongoDB;

$VERSION     = 1.00;
@ISA         = qw(Exporter);
@EXPORT      = qw();
@EXPORT_OK   = qw();
%EXPORT_TAGS = ( DEFAULT =&gt; [qw()],
                 Both    =&gt; [qw()]);

sub new {
    my ($class, $args) = @_;
    my $self = {
        host     =&gt; $args-&gt;{host} || 'localhost',       
        port     =&gt; $args-&gt;{port} || '27017',
        database =&gt; $args-&gt;{database} || '',
        connection =&gt; $class-&gt;_set_connection(),
    };
    return bless $self, $class;
}

sub _set_connection {
    my $self = shift;
    my $client = MongoDB-&gt;connect('mongodb://localhost');
    return $client;
}

sub get_database_names {
    # Lists all databases on the mongo server
    my $self = shift;
    return  $self-&gt;{connection}-&gt;database_names;
}

sub get_database {
    # Returns a MongoDB::Database instance for database with the given $name
    my ($self, $dbname) = @_;
    return $self-&gt;{connection}-&gt;get_database($dbname);
}

sub authenticate {
    my ($self, $args) = @_;
    $self = {
        dbname =&gt; $args-&gt;{dbname},
        user =&gt; $args-&gt;{user},
        password =&gt; $args-&gt;{password}
    };
    $self-&gt;{connection}-&gt;authenticate($self-&gt;{dbname}, $self-&gt;{user}, $self-&gt;{password});
}
1;
I'm the lead engineer for the MongoDB Perl driver with a couple of thoughts for you:


you're using 'authenticate', which is for a very old version of the driver which is not recommended for use.  In the v1.x series, you should provide username/password in the URI or in MongoClient parameters.
Most of the value of this module seems to be setting parameters and calling connect.  I would suggest doing that with a function, not a module and then just using the resulting MongoDB::MongoClient object directly.