diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm index ee74a8f..b3633fe 100644 --- a/lib/Net/Ping.pm +++ b/lib/Net/Ping.pm @@ -367,7 +367,7 @@ sub ping ); croak("Usage: \$p->ping(\$host [, \$timeout])") unless @_ == 2 || @_ == 3; - $timeout = $self->{"timeout"} unless $timeout; + $timeout = $self->{"timeout"} unless defined $timeout; croak("Timeout must be greater than 0 seconds") if $timeout <= 0; $ip = inet_aton($host);