1#!./perl 2 3BEGIN { 4 require Config; import Config; 5 if ($Config{'extensions'} !~ /\bSys\/Hostname\b/) { 6 print "1..0 # Skip: Sys::Hostname was not built\n"; 7 exit 0; 8 } 9} 10 11use Sys::Hostname; 12 13eval { 14 $host = hostname; 15}; 16 17if ($@) { 18 print "1..0\n" if $@ =~ /Cannot get host name/; 19} else { 20 print "1..1\n"; 21 print "# \$host = '$host'\n"; 22 print "ok 1\n"; 23} 24