home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / t / lib / hostname.t < prev    next >
Text File  |  2000-02-15  |  274b  |  21 lines

  1. #!./perl
  2.  
  3. BEGIN {
  4.     chdir 't' if -d 't';
  5.     unshift @INC, '../lib';
  6. }
  7.  
  8. use Sys::Hostname;
  9.  
  10. eval {
  11.     $host = hostname;
  12. };
  13.  
  14. if ($@) {
  15.     print "1..0\n" if $@ =~ /Cannot get host name/;
  16. } else {
  17.     print "1..1\n";
  18.     print "# \$host = `$host'\n";
  19.     print "ok 1\n";
  20. }
  21.