chacon has asked for the wisdom of the Perl Monks concerning the following question:
sub send { @_ >= 2 && @_ <= 4 or croak 'usage: $sock->send(BUF,[FLAGS, [TO]])'; my $sock = $_[0]; my $flags = $_[2] || 0; my $peer = $_[3] || $sock->peername; croak 'send: Cannot determine peer address' unless($peer); ################################################ ################################################ THE ERROR IS GENERATE WHEN EXECUTE THE NEXT LINE ################################################ ################################################ my $r = defined(getpeername($sock)) ? send($sock, $_[1], $flags) : send($sock, $_[1], $flags, $peer); # remember who we send to, if it was successful ${*$sock}{'io_socket_peername'} = $peer if(@_ == 4 && defined $r); $r; }
Edited by Chady -- Added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wide character problem using Socket.pm
by ni-s (Initiate) on Sep 09, 2004 at 19:25 UTC | |
|
Re: Wide character problem using Socket.pm
by bart (Canon) on Sep 09, 2004 at 19:43 UTC |