in reply to Re: error catching in mongodb and perl
in thread error catching in mongodb and perl

i got an error while using MogoDB::MongoClient as below,i tried to install using cpan but its not istalling.

use MongoDB; use JSON; use Data::Dumper; $client = MongoDB::MongoClient->new( host => 'remote_machine_ip:270 +17'); $client->connect; $client->authenticate('username', 'password', 'authenticationdb'); my $database = $client->get_database('prav'); my $collection = $database->get_collection( 'student'); my $data=$collection->find(); while (my $doc = $data->next) { my @qual=@{$doc->{'qualifications'}}; print @qual; print "\n"; } Can't locate object method "new" via package "MongoDB::MongoClient" (p +erhaps you forgot to load "MongoDB::MongoClient"?) at .. cpan MongoDB::MongoClient ---also tried cpan MongoDB .... .... Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible

Replies are listed 'Best First'.
Re^3: error catching in mongodb and perl
by boftx (Deacon) on Nov 10, 2014 at 08:31 UTC

    What was the error when trying to install MongoDB::MongoClient? That appears to be the crux of the matter.

    You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

      error while istalling MOngoClient

      In file included from bson/bson.h:23, from ./perl_mongo.h:22, from xs\BSON.xs:17: bson/bson-compat.h:96: error: expected '=', ',', ';', 'asm' or '__attr +ibute__' b efore 'INIT_ONCE' dmake.EXE: Error code 129, while making 'xs\BSON.o' MONGODB/MongoDB-v0.706.0.0.tar.gz C:\Dwimperl\c\bin\dmake.EXE -- NOT OK CPAN: YAML loaded ok (v0.77) Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible
        I think you should provide more context (like full unhidden manual session) ... trimming context is great if you know the solution