Hello, with the hash below, I would like the clients array's reference :
my $this =
{
'name' => $name,
'max_clients' => $max_clients,
'clients' => ()
};
I can't do "\$this{'clients'};" to retrieve the reference.
Hello, with the hash below, I would like the clients array's reference :
my $this =
{
'name' => $name,
'max_clients' => $max_clients,
'clients' => ()
};
I can't do "\$this{'clients'};" to retrieve the reference.
You cannot store an array as a value in a hash table. You can only store a scalar value such as a reference to an array:
my $this =
{
'name' => $name,
'max_clients' => $max_clients,
'clients' => [],
};
See also perldoc perldsc.