Message-ID: <87n0m3v6yp.fsf@vran.herceg.de>
p4raw-id: //depot/perl@18597
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 {
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') {