Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sys::Hostname

Native Rust implementation built into the interpreter. Runtime: PP. See original documentation for the full Perl reference.

Provides hostname retrieval functionality.

Functions

hostname

Returns the hostname of the current machine via libc gethostname().

use Sys::Hostname;
my $host = hostname();

See also: Cwd, POSIX