Util::Medley::Hostname - Utilities for dealing with hostnames.
version 0.037
$util = Util::Medley::Host->new; $bool = $util->isFqdn('foobar.example.com'); ($hostname, $domain) = $util->parseHostname('foobar.example.com'); $shortHostname = $util->stripDomain('foobar.example.com');
Utility module for slicing and dicing hostnames.
All methods confess on error.
Checks if a given hostname is fully qualified.
$bool = $util->isFqdn('foobar.example.com'); $bool = $util->isFqdn(hostname => 'foobar.example.com');
Hostname to be checked.
Parses the specified hostname into hostname and domain (if exists).
($hostname, $domain) = $util->parseHostname('foobar.example.com'); ($hostname, $domain) = $util->parseHostname(hostname => 'foobar.example.com');
Hostname you wish to parse.
Returns short-hostname for the provided hostname.
$hostname = $util->stripDomain('foobar.example.com'); $hostname = $util->stripDomain(hostname => 'foobar.example.com');
Hostname to be stripped.
To install Util::Medley, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Util::Medley
CPAN shell
perl -MCPAN -e shell install Util::Medley
For more information on module installation, please visit the detailed CPAN module installation guide.