use Sys::Hostname; $host = hostname;
`hostname`
`uname -n`
All nulls, returns, and newlines are removed from the result.
Texas Instruments