title: Capture short host name using built-in Perl modules?
body: <p>Is there a cleaner way to do</p>
  
  <pre><code>use Sys::Hostname qw(hostname);
  
  my $hostname = hostname();
  $hostname =~ s/\.domain//;
  </code></pre>
  
  <p>Basically, is it possible to strip the hostname down to its short name without running two <code>$hostname</code> assignments and without additional modules?</p>