If your just looking for the flat hostname you can use the Win32::NodeName()
function like this:

my $hostname = Win32::NodeName;

or if you want to write portable code I would suggest using:

use Net::Domain qw(hostfqdn);
my $fqdn = hostfqdn();

Kind regards,
Trevor J. Joerges
--------------------------------------------
$_=q;rrUSFWPSZK.ZKPFSHFT,rkvtuZbopuifsZQZibdl
rrqpxfsfeZcyZQ,,riuuq://xxx.%.dpn,ru~@%.dpn ,rrr8-)
;;s;\~;kpfshft;g;s;\%;tfoenjnf;g;y;B-x;A-w;;
s;P;perl;g;s;,;\n;g;s;Y; ;g;s;q;\t;g;print;
--------------------------------------------

----- Original Message -----
From: "Marcos Lorenzo de Santiago" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 11, 2002 3:33 PM
Subject: how can I get the hostname?


| how can I get the name of the hostname the perl script runs on.
| I mean not executing syscalls but through only Perl code.
|
| thx in advance.
|
| m4c.
|
| _______________________________________________
| Perl-Win32-Admin mailing list
| [EMAIL PROTECTED]
| To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to