Re: Help for z39.50 search in proquest dissertations and theses

[email protected] (Ashley Sanders)
Newsgroups perl.perl4lib
Message-ID <[email protected]>
Anne L. Highsmith wrote:
> I am trying to create a perl program using Net::Z3950 to connect to and search the proquest dissertations and theses database. I can connect and search via YAZ, but am having no luck via perl/Net::Z3950.
> 
> Here's the perl program:
> use Net::Z3950;
> $mgr = new Net::Z3950::Manager(
>         user=>'[user]',
>         pass=>'[password]',
>         );

> $target = 'proquest-z3950.umi.com';
> $port = '210';
> $database = 'PQD';
> $recordSyntax = 'SUTRS';
> $conn = new Net::Z3950::Connection($mgr, $target, $port, databaseName =>$database) or die "$!\n";
> $rs = $conn->search(-prefix => '@and @attr 1=4 steamboat bertrand') or die "$!\n";
> $count = $rs->size();
> print "$count\n" and die;
> 
> When I have the "$!\n"; in the '$rs = ' line, I always get the message "Operation in progress". 
> When I remove the "$!\n"; in the '$rs = ' line, and it falls through to $count = $rs->size(); , I get:
> Can't call method "size" on an undefined value at ./zd line 13.

I've never used Net::Z3950, but my understanding of the Manager
class is that it is that connection is being made
asynchronously -- which means you need to use the wait()
function, as in the example here:

    http://perl.z3950.org/docs/Z3950/Manager.html

You could try adding "async => 0" to the Manager object
construction, ie:

$mgr = new Net::Z3950::Manager(async => 0, user => xxx, pass => yyy);

or perhaps adding it here instead:

   $conn = new Net::Z3950::Connection($mgr, $host, $port, async => 0);

Hope this helps,

Regards,

Ashley.
-- 
Ashley Sanders               [email protected]
Copac http://copac.ac.uk A Mimas service funded by JISC
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.