When I am running this code inside of a module that inherits from Net::Server, MongoDB doesn't seem to work:
use base qw(Net::Server);
When I call this code without that inheritance, it works fine.
Can't locate object method "run_command" via package "MongoDB::Database" at /usr/local/lib/perl5/MongoDB/Connection.pm line 519
MongoDB::Connection::_get_max_bson_size('MongoDB::Connection=HASH(0x9d48bc8)') called at /usr/local/lib/perl5/MongoDB/Connection.pm line 463
MongoDB::Connection::BUILD('MongoDB::Connection=HASH(0x9d48bc8)', 'HASH(0x9d48ba8)') called at /opt...
Here is the line that is failing:
$mongo_handle =
MongoDB::Connection->new( 'host' => 'mongodb://' . $host . ':' . $port );