From: Hrunting Johnson (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-22965-60791.13.
0539297217452@rt.perl.org>
p4raw-id: //depot/perl@20193
sub timeout {
@_ == 1 || @_ == 2 or croak 'usage: $sock->timeout([VALUE])';
my($sock,$val) = @_;
- my $r = ${*$sock}{'io_socket_timeout'} || undef;
+ my $r = ${*$sock}{'io_socket_timeout'};
- ${*$sock}{'io_socket_timeout'} = 0 + $val
+ ${*$sock}{'io_socket_timeout'} = defined $val ? 0 + $val : $val
if(@_ == 2);
$r;