couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Miguel Silva <luismiguelferreirasi...@gmail.com>
Subject [somewhat off-topic] Any good perl modules for consuming CouchDB? Having trouble with Perl's CouchDB::Client
Date Thu, 31 Mar 2011 17:28:17 GMT
Dear all,

Sorry for yet another email but i was wondering if anybody in the
community has had good experiences querying views from Perl?
I'm trying CouchDB::Client perl module but i simply cannot consume a
view i created...

        my $db = $c->newDB('mydatabase');
        print "puff\n";
        my $view = $db->newDesignDoc('_design/testviewdoc')->retrieve;
        my $result = try {
                $view->queryView('testviewname');
        } catch {
                die "Could not query view";
        };

This throws a JSON error:
[root@x06 ~]#
puff
malformed JSON string, neither array, object, number, string or atom,
at character offset 0 (before "<!DOCTYPE html>\n<!-...") at
/usr/lib/perl5/site_perl/5.8.8/JSON/Any.pm line 571
[root@x06 ~]#

I can consume the view directly from the web service:
http://x06:5984/mydatabase/_design/testviewdoc/_view/testviewname

I'm not sure if i'm doing something wrong with CouchDB::Client so i
just wanted to ask for alternatives to it? (or if someone knows what's
going on)

p.s. i understand this isn't a real CouchDB specific question but
thought the community might be able to help me with this one :o)

Thanks in advance,
Luis Silva

Mime
View raw message