Sisimai::RFC1123(3pm)

πŸ“¦
version 5.7.0 Β· 3 versions
, in ubuntu stonking

πŸ’– Sisimai::RFC1123(3pm) πŸ’–

okay bestie, gather round, because this one is a little Perl class from the User Contributed Perl Documentation collection and it is, lowkey, exactly what you need when you're staring at a hostname and going "…is this valid or are you lying to me?" πŸ¦‹

It's called Sisimai::RFC1123 and no cap, it's all about Internet hosts. Let's get into it. πŸ’…


✨ NAME ✨

Sisimai::RFC1123 β€” the Internet hostname related class πŸŽ€


✨ SYNOPSIS ✨

Here's you, living your life, actually using it:

use Sisimai::RFC1123;

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

See how "mx2.example.jp" said 1 (slay, valid) and "localhost" said 0 (not an Internet host, sorry girl)? That's the whole vibe. πŸ‘‘


✨ DESCRIPTION ✨

"Sisimai::RFC1123" is a class related to the Internet hosts. That's it, that's the description, it's giving focused. πŸ’œ


✨ CLASS METHODS ✨

🌸 "is_internethost(String)"

The is_internethost() method returns true when the argument is a valid hostname. Literally that simple, no drama, main character energy only. ✨

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

🌸 "is_domainliteral(String)"

The is_domainliteral() method returns true when the domain part of the argument begins with "[IPv4:" or "[IPv6:" and is a valid domain literal. So if you're out here passing a bare IP without the little IPv4: / IPv6: tag, bestie, it's gonna say no. πŸ™ˆ

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

Two different results, two different vibes, IPv4: is doing all the heavy lifting. 🫢


✨ AUTHOR ✨

azumakuniyuki πŸ‘‘


Copyright (C) 2024-2026 azumakuniyuki, All rights reserved.


✨ LICENSE ✨

This software is distributed under The BSD 2-Clause License. Go forth, use it responsibly, it's fr fr licensed. 🌈


aaaand that's the page, bestie! πŸŽ€ This was perl v5.40.1, dated 2026-07-05, coming to you from the Sisimai::RFC1123(3pm) manual. Hostname checks have never been this cute. Stay valid, stay iconic, mwah πŸ’–πŸ’…

πŸ“¦ where this page comes from