Sisimai::RFC1123(3pm)
π 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 β¨
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
- ubuntu stonking: libsisimai-perl 5.7.0-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms