in reply to DBI::ProxyServer question

It's been a long time ago, but I used to use the supplied command line tool, dbiproxy. The source of that script is basically DBI::ProxyServer::main(@ARGV);. That seems to indicate what DBI::ProxyServer suggests too, namely that you're supposed to supply it with a list of options, which will be parsed by Getopt::Long.

Based on this, I believe your script should drop the {}s around the options.

Replies are listed 'Best First'.
Re^2: DBI::ProxyServer question
by rhesa (Vicar) on Oct 02, 2007 at 12:26 UTC
    Sorry for not actually testing what I wrote earlier. I've given it some more attention, and I've come to the conclusion that you also need to prefix the option names with a '-'.

    This script:

    #!/usr/bin/perl -w # Server component of SQLite client/server prototype. use DBI::ProxyServer; { DBI::ProxyServer::main( # clients => [ '192.168.0.115' ], -debug => 1, -localport => 16000, -logfile => '/tmp/Server.log', -mode => 'fork', -pidfile => '/tmp/Server.pid', , @ARGV); }
    produces the following output:
    Use of uninitialized value in string eq at /opt/perl/lib/site_perl/5.8 +.8/i686-linux/DBI/ProxyServer.pm line 99. Tue Oct 2 12:21:27 2007 debug, Server starting in operation mode fork Tue Oct 2 12:21:27 2007 notice, Server starting Tue Oct 2 12:21:27 2007 debug, Writing PID to /tmp/Server.pid
    Furthermore, netstat shows it's listening on port 16000:
    $ netstat -natp | grep LIST tcp 0 0 0.0.0.0:16000 0.0.0.0:* LISTEN 2624/perl
    I suspect you'll need to read the docs for the exact specs for the clients option, as I saw it said the elements are supposed to be hashrefs. I didn't bother testing that.

    HTH,
    Rhesa