in reply to Re: I need simple socket tutorial (or any other way to connect via UDP).
in thread I need simple socket tutorial (or any other way to connect via UDP).

As a side note, why is the recv() subroutine set up so strangely? Passing the variable that will hold what the function returns reminds me of PHP and its "forced references". Wouldn't this code be much more intuitive and Perlish?

$reponse = $socket->recv($length, $flags);

And for that matter, how is this even done? I would think you'd at least need the name of the variable to set it from another package. Isn't passing an uninitialized variable the same as passing an empty string? I'm all confused, perhaps someone could explain what I think are the relevant bits of recv() in IO::Socket:
my $sock = $_[0]; ${*$sock}{'io_socket_peername'} = recv($sock, $_[1]='', $len, $flags);