V
Vito Corleone
Hi,
I downloaded a module that need me to input the value in very confusing
way. For example:
$m = Module::->new(
{ 'servers' => [ "192.168.1.0:5500", "192.168.1.1:5500" ],
'debug' => 0 } );
You put the list of your servers IP and port number into servers. I put
my servers list in config file. It looks like this:
use constant SERVERS => '192.168.1.0:5500 192.168.1.1:5500';
And then when I load the module, I do:
my @servers = split(" ", SERVERS);
$m = Module::->new(
{ 'servers' => \@servers,
'debug' => 0 } );
So far so good. But you can also load the module this way.
$m = Module::->new(
{ 'servers' => [ "192.168.1.0:5500", ["192.168.1.1:5500", 3] ],
'debug' => 0 } );
Besides IP and port number, it also takes the value of the server (ie:
3). I want to make my config file looks like:
use constant SERVERS => '192.168.1.0:5500 192.168.1.1:5500,3';
But I don't know how can I pass these values to the module. Or is there
any better way to keep these values in config file? Please help, and
thanks in advance.
--vc
I downloaded a module that need me to input the value in very confusing
way. For example:
$m = Module::->new(
{ 'servers' => [ "192.168.1.0:5500", "192.168.1.1:5500" ],
'debug' => 0 } );
You put the list of your servers IP and port number into servers. I put
my servers list in config file. It looks like this:
use constant SERVERS => '192.168.1.0:5500 192.168.1.1:5500';
And then when I load the module, I do:
my @servers = split(" ", SERVERS);
$m = Module::->new(
{ 'servers' => \@servers,
'debug' => 0 } );
So far so good. But you can also load the module this way.
$m = Module::->new(
{ 'servers' => [ "192.168.1.0:5500", ["192.168.1.1:5500", 3] ],
'debug' => 0 } );
Besides IP and port number, it also takes the value of the server (ie:
3). I want to make my config file looks like:
use constant SERVERS => '192.168.1.0:5500 192.168.1.1:5500,3';
But I don't know how can I pass these values to the module. Or is there
any better way to keep these values in config file? Please help, and
thanks in advance.
--vc