in reply to Find a networked computer name

Update: I just re-read your question and...I'm not sure if I read it correctly the first time.

1) Do you want to find, from within Perl, the network visible name of the local computer?

Or

2) Find the name of your computer, as seen by the network, using Perl on a remote computer?

If you meant 1), then the following should do it. If you meant the second, that's different and more info is needed.

</update>

use Sys::Hostname; print hostname;

Should work pretty much anywhere, as the docs say

Sys::Hostname - Try every conceivable way to get hostname

On (some/most/all) Win32 you can do

print $ENV{COMPUTERNAME};

but the first one above is portable.


Examine what is said, not who speaks.