I am looking into the IO:Socket.pm module and I see the first time the "*$sock" notation.
sub socket {
@_ == 4 or croak 'usage: $sock->socket(DOMAIN, TYPE, PROTOCOL)';
my($sock,$domain,$type,$protocol) = @_;
socket($sock,$domain,$type,$protocol) or
return undef;
${*$sock}{'io_socket_domain'} = $domain;
${*$sock}{'io_socket_type'} = $type;
${*$sock}{'io_socket_proto'} = $protocol;
$sock;
}
What is the intent of the following syntax ?
${*$sock}{'io_socket_domain'} = $domain;
Especially I am referring to the asterisk notation ... $sock is an object as far I understand but what is this thing: ${*$sock} ? And how is this asterisk operator called and its purpose?
I would be grateful if someone can make me see with some practical minimalistic example.