Change 18597 by rgs@rgs-home on 2003/01/27 21:52:00

        Subject: Re: [perl #20274] perlbug requires dynamic loading
        From: Slaven Rezic <[EMAIL PROTECTED]>
        Date: 14 Jan 2003 20:58:54 +0100
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/ext/Sys/Hostname/Hostname.pm#3 edit

Differences ...

==== //depot/perl/ext/Sys/Hostname/Hostname.pm#3 (text) ====
Index: perl/ext/Sys/Hostname/Hostname.pm
--- perl/ext/Sys/Hostname/Hostname.pm#2~17840~  Wed Sep  4 06:55:20 2002
+++ perl/ext/Sys/Hostname/Hostname.pm   Mon Jan 27 13:52:00 2003
@@ -5,17 +5,27 @@
 use Carp;
 
 require Exporter;
-use XSLoader ();
 require AutoLoader;
 
 our @ISA     = qw/ Exporter AutoLoader /;
 our @EXPORT  = qw/ hostname /;
 
-our $VERSION = '1.1';
+our $VERSION;
 
 our $host;
 
-XSLoader::load 'Sys::Hostname', $VERSION;
+BEGIN {
+    $VERSION = '1.1';
+    {
+       local $SIG{__DIE__};
+       eval {
+           require XSLoader;
+           XSLoader::load('Sys::Hostname', $VERSION);
+       };
+       warn $@ if $@;
+    }
+}
+
 
 sub hostname {
 
@@ -23,7 +33,7 @@
   return $host if defined $host;
 
   # method 1' - try to ask the system
-  $host = ghname();
+  $host = ghname() if defined &ghname;
   return $host if defined $host;
 
   if ($^O eq 'VMS') {
End of Patch.

Reply via email to