Beau E. Cox wrote:
On Monday 20 February 2006 10:06, Tom Allison wrote:
package AuthServer;
@ISA = qw[Net::Server];
my $server = bless {
port => 8081,
}, 'AuthServer';
$server->run();
No. This _works_:
package AuthServer;
use Net::Server;
@ISA = qw[Net::Server];
AuthServer->run( port => 8081 );
exit;
1;
You need a 'use Net::Server'; you may want to pick
one of new server's sub classes: New::Server::PreFork,
etc.
You should pass 'port' as a parameter to 'run'.
Add at least a 'sub process_request' method to
actually do the work.
READ the docs; my example above is straight from the
SYNOPSIS! :)
Yes.
I can do this too. But I wanted to try it by the second method identified in
the perldoc:
#!/usr/bin/perl -w -T
#--------------- file test2.pl ---------------
package MyPackage;
use strict;
use vars (@ISA);
use Net::Server;
@ISA = qw(Net::Server);
my $server = bless {
key1 => 'val1',
}, 'MyPackage';
$server->run();
#--------------- file test.pl ---------------
Which ignores the key1 parameter in my script.
This allows me to hard code some specifics early on.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>