#!/usr/bin/perl -wT # Note the -T switch! This is always recommended for Perl servers. use strict; # Always a good choice. require RPC::PlServer; require MD5; package MD5_Server; # Clients need to request application # "MD5_Server" $MD5_Server::VERSION = '1.0'; # Clients will be refused, if they # request version 1.1 @MD5_Server::ISA = qw(RPC::PlServer); eval { # Server options below can be overwritten in the config file or # on the command line. my $server = MD5_Server->new({ 'pidfile' => '/var/run/md5serv.pid', 'configfile' => '/etc/md5serv.conf', 'facility' => 'daemon', # Default 'user' => 'nobody', 'group' => 'nobody', 'localport' => 2000, 'logfile' => 0, # Use syslog 'mode' => 'fork', # Recommended for Unix 'methods' => { 'MD5_Server' => { 'ClientObject' => 1, 'CallMethod' => 1, 'NewHandle' => 1 }, 'MD5' => { 'new' => 1, 'add' => 1, 'hexdigest' => 1 }, } }); $server->Bind(); };