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


    use Sys::Hostname;
    $host = hostname;


Attempts several methods of getting the system hostname and then caches the result. It tries the first available of the C library’s gethostname(), "`$Config{aphostname}`", uname(2), "syscall(SYS_gethostname)", "`hostname`", "`uname −n`", and the file /com/host. If all that fails it "croak"s.

All NULs, returns, and newlines are removed from the result.


David Sundstrom <>

Texas Instruments

XS code added by Greg Bacon <>

More Linux Commands

ber_bvfree(3) - OpenLDAP LBER types and allocation functions
The following are the basic types and structures defined for use with the Lightweight BER library. ber_int_t is a signed integer of at least 32 bits. It is comm

getdirentries(3) - get directory entries in a file system-in
Read directory entries from the directory specified by fd into buf. At most nbytes are read. Reading starts at offset *basep, and *basep is updated with the new

pcre32_free_substring(3) Perl-compatible regular expressions
This is a convenience function for freeing the store obtained by a previous call to pcre[16|32]_get_substring() or pcre[16|32]_get_named_substring(). Its only a

Tcl_LimitSetCommands(3) - manage and check resource limits o
Tcls interpreter resource limit subsystem allows for close control over how much computation time a script may use, and is useful for cases where a program is d

mv(1) - move (rename) files (Commands - Linux man page).....
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too. --backup[=CONTROL] make a backup

gnutls_openpgp_crt_get_pk_rsa_raw(3) - API function.........
gnutls_openpgp_crt_get_pk_rsa_raw.3 - This function will export the RSA public keys parameters found in the given structure. The new parameters will be allocate

outsl(2) - port I/O (System calls - Linux man page).........
This family of functions is used to do low-level port input and output. The out* functions do port output, the in* functions do port input; the b-suffix functio

toplevel(n) - Create and manipulate toplevel widgets........
The toplevel command creates a new toplevel widget (given by the pathName argument). Additional options, described above, may be specified on the command line o

key_encryptsession(3) - interfaces to rpc keyserver daemon
The functions here are used within the RPCs secure authentication mechanism (AUTH_DES). There should be no need for user programs to use this functions. The fun

snmpd(8) - daemon to respond to SNMP request packets........
snmpd is an SNMP agent which binds to a port and awaits requests from SNMP management software. Upon receiving a request, it processes the request(s), collects

gserialver-4.6(1) - version command - Linux manual page.....
Print the serialVersionUID of the specified classes. OPTIONS -classpath PATH Class path to use to find classes. Standard options: -help Print help text, then ex

Tcl_SetByteArrayObj(3) - manipulate Tcl objects as a arrays
These procedures are used to create, modify, and read Tcl byte-array objects from C code. Byte-array objects are typically used to hold the results of binary IO

We can't live, work or learn in freedom unless the software we use is free.