NAME
Util::Medley::Hostname - Utilities for dealing with hostnames.
VERSION
version 0.062
SYNOPSIS
$util = Util::Medley::Host->new;
$bool = $util->isFqdn('foobar.example.com');
($hostname, $domain) = $util->parseHostname('foobar.example.com');
$shortHostname = $util->stripDomain('foobar.example.com');
DESCRIPTION
Utility module for slicing and dicing hostnames.
All methods confess on error.
METHODS
isFqdn
Checks if a given hostname is fully qualified.
- usage:
-
$bool = $util->isFqdn('foobar.example.com'); $bool = $util->isFqdn(hostname => 'foobar.example.com');
- args:
parseHostname
Parses the specified hostname into hostname and domain (if exists).
- usage:
-
($hostname, $domain) = $util->parseHostname('foobar.example.com'); ($hostname, $domain) = $util->parseHostname(hostname => 'foobar.example.com');
- args:
stripDomain
Returns short-hostname for the provided hostname.