1. Perl
  2. Module
  3. here

Sys::Hostname - Get Hostname

You can get the hostname using the Sys::Hostname module.

# Loading modules and importing functions
use Sys::Hostname 'hostname';

Use the hostname function to get the hostname.

# Get host name
my $host = hostname;

Related Informatrion