Subject: | Failure reading empty options in Net::Bind::Resolv |
Hi * !
The options method in Net::Bind::Resolv causes an error when (Can't use undefined value as list reference) when called in list context as options(); on a resolv.conf file without any options.
The patch attached fixes this.
Regards,
Martin Kutter
--- Net-Bind-0.05/lib/Net/Bind/Resolv.pm 2002-04-17 22:22:47.000000000 -0400
+++ Net-Bind-0.05/lib/Net/Bind/Resolv.pm.patched 2004-03-03 05:07:43.000000000 -0500
@@ -321,8 +321,11 @@
@$item : $item);
}
}
-
- return wantarray ? @{$self->{Options}} : $self->{Options};
+ if (wantarray) {
+ return @{$self->{Options}} if ($self->{Options});
+ return ();
+ }
+ return $self->{Options};
}
=head2 comments([@strings])