This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handy.h: Add an enum typedef
[perl5.git] / win32 / config_sh.PL
index 3733c47..d866f76 100644 (file)
@@ -103,8 +103,12 @@ if (exists $opt{cc}) {
 }
 
 $opt{cf_by} = $ENV{USERNAME} unless $opt{cf_by};
-$opt{cf_email} = $opt{cf_by} . '@' . (gethostbyname('localhost'))[0]
-       unless $opt{cf_email};
+if (!$opt{cf_email}) {
+    my $computername = eval{(gethostbyname('localhost'))[0]};
+# gethostbyname might not be implemented in miniperl
+    $computername = $ENV{COMPUTERNAME} if $@;    
+    $opt{cf_email} = $opt{cf_by} . '@' . $computername;
+}
 $opt{usemymalloc} = 'y' if $opt{d_mymalloc} eq 'define';
 
 $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};