Path: usenet.cise.ufl.edu!usenet.eel.ufl.edu!news.mathworks.com!howland.erols.net!EU.net!Norway.EU.net!nntp.uio.no!news.cais.net!in1.nntp.cais.net!news.structured.net!crusty.teleport.com!nntp0.teleport.com!usenet From: Alex Hristov Newsgroups: comp.lang.perl.announce,comp.lang.perl.misc Subject: About to announce Net::Ph (beta) Followup-To: comp.lang.perl.misc Date: 7 Nov 1996 14:50:20 GMT Organization: Omnes Lines: 122 Approved: merlyn@stonehenge.com (comp.lang.perl.announce) Message-ID: <55ssvc$7ib@nadine.teleport.com> NNTP-Posting-Host: gadget.cscaper.com X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content. Xref: usenet.cise.ufl.edu comp.lang.perl.announce:48 comp.lang.perl.misc:7507 Ladies & gentlemen, a little announcement: After looking at Graham Barr's (Graham_Barr@tiuk.ti.com)code in Net::Cmd and Net::FTP, I decided to extend the Net library with Net::Ph. For almost a year I was writing simple cgi scripts in perl to deal with the CCSO Nameserver (aka PH) developed by the University of Illinois at Urbana-Champaigne. The CCSO Nameserver is a database containing info about people in an organization. It consists of a "qi" server and a "ph" client; the latter available for variety of platforms (UNIX, DOS, Win, Mac, VMS). Even, the Qualcomm Eudora mail application comes with an integrated ph client. This client/server environment serves as a centralized database for Schlumberger Ltd.(the company I'm working for). Simply stated, it is a phone directory. The server implementation is quite similar to an ftp daemon: it uses a command-reply scheme. Commands consist of keywords followed by one or more arguments; replies consist of numerical codes (-599 to 599) and additional text. List of commands: ================= query [field=]value... [return field...] change [field=]value... make field=value... login alias answer code clear password logout fields [field...] set option[=value]... * id information * add field=value... delete [feild=]value... status * siteinfo * help [{native|client} [topic...]] * quit *not considered in Net::Ph for now List of reply categories: ========================= 100-199 operation in progress 200-299 success 300-399 a request for further information 400-499 temporary failure 500-599 permanent failure -599 to -100 more replies to be expected for the current command; have the same meaning as their positive counterparts Here is a brief description of Net::Ph. =========== constructor new (HOST [,OPTIONS]) example: $ph = Net::Ph->new("host.name", Port=>105, Timeout=>20); methods open_query (FIELDS,RETURN_FIELDS [, USER, PASS, ENCRYPTED]) example: $qh= $ph->open_query(-fields=>{'field1'=>'value1', 'field2'=>'value2'}, -return_fields=>['value1','value2'], -user=>'username', -pass=>'password', -encrypted=>1); read_query (QH [, POS]) example: $pos = 1; while ( (($status,$buf) = $ph->read_query($qh,$pos)) ) { foreach $field (sort keys %$buf) { print "$field = $buf->{$field}\n"; } $pos++; } close_query (QH) example: close_query($qh); add (FIELDS [, USER, PASS, ENCRYPTED]) example: ($status,$qh) = $ph->add(-fields=>{'field1'=>'value1'}, -user=>'username', -pass=>'password', -encrypted=>1); close_query($qh); delete (FIELDS [, USER, PASS, ENCRYPTED]) example: ($status,$qh) = $ph->delete(-fields=>['value1','value2']); close_query($qh); change (SEARCH_FIELDS, CHANGE_FIELDS [, USER, PASS, ENCRYPTED]) example: ($status, $qh) = $ph->change(-search_fields=>['value1'], -change_fields=>{'field2'=>'value2'}, -user=>'username', -pass=>'password'); close_query($qh); quit example: $ph->quit(); ======================== Feel free to look at the code and the manual page available at: http://www.omnes.net/~alex/net_ph/ No installation script is avalable yet. I just keep Ph.pm in ..../site_perl/Net Any suggestions are more than welcome and appreciated. Regards, Alex Hristov (hristov@slb.com) -- .