Sisimai::RFC1123(3pm)

NAME
Sisimai::RFC1123 - Internet hostname related class

SYNOPSIS
    use Sisimai::RFC1123;

    print Sisimai::RFC1123->is_internethost("mx2.example.jp"); # 1
    print Sisimai::RFC1123->is_internethost("localhost");      # 0

DESCRIPTION
"Sisimai::RFC1123" is a class related to the Internet hosts

CLASS METHODS

  "is_internethost(String)"
is_internethost() method returns true when the argument is a valid hostname

    print Sisimai::RFC1123->is_internethost("mx2.example.jp"); # 1
    print Sisimai::RFC1123->is_internethost("localhost");      # 0

  "is_domainliteral(String)"
is_domainliteral() method returns true when the domain part of the argument begins with "[IPv4:" or "[IPv6:" and is a valid domain literal.

    print Sisimai::RFC1123->is_domainliteral("neko@[IPv4:192.0.2.1]);   # 1
    print Sisimai::RFC1123->is_domainliteral("neko@[192.0.2.1]);        # 0

AUTHOR
azumakuniyuki

COPYRIGHT
Copyright (C) 2024,2025 azumakuniyuki, All rights reserved.

LICENSE
This software is distributed under The BSD 2-Clause License.