about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2004-03-20 12:15:21 +0000
committerGraham Barr <gbarr@pobox.com>2009-02-24 08:51:37 -0600
commit2d05e2805ff808db40b872746cd5c0332f0b2577 (patch)
treea794dc802abe93570918dd630749f0c79860b1b5
parentcfd65fda23d20e179fe0bc41c52aa8290570b3bb (diff)
downloadperl-libnet-2d05e2805ff808db40b872746cd5c0332f0b2577.tar.gz
Avoid undef warnings
-rw-r--r--t/hostname.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/hostname.t b/t/hostname.t
index e085591..9db66a9 100644
--- a/t/hostname.t
+++ b/t/hostname.t
@@ -32,11 +32,11 @@ else {
  print "not ok 1\n";
 }
 
-# This check thats hostanme does not overwrite $_
+# This checks thats hostanme does not overwrite $_
 my @domain = qw(foo.example.com bar.example.jp);
 my @copy = @domain;
 
-my @dummy = grep { hostname eq $_ } @domain;
+my @dummy = grep { defined hostname() and hostname() eq $_ } @domain;
 
 ($domain[0] && $domain[0] eq $copy[0])
   ? print "ok 2\n"