App::C...H::Host(3pm)
π App::C...H::Host π
User Contributed Perl Documentation Β· the ClusterSSH host object, bestie π¦
okay so real talk: this entire page is about ONE lil object that holds everything you need to actually go talk to a machine. πΈ where it lives, who you are when you get there, which port you're knocking on. that's it. that's the module. and honestly? it ate. π
β¨ SYNOPSIS β¨
use ClusterSSH::Host;
my $host = ClusterSSH::Host->new({
hostname => 'hostname',
});
my $host = ClusterSSH::Host->parse_host_string('username@hostname:1234');
πΈ DESCRIPTION πΈ
An object representing a host. like, it's a lil bundle of everything you need to contact that host β hostname / ipaddress, username, and port. all cozy in one object. π«Ά
π METHODS π
π« $host=ClusterSSH::Host->new ({ hostname => 'hostname' })
Creates a brand new host object, no cap. 'hostname' is a required arg β you cannot skip it, bestie, it will simply not happen. 'username' and 'port' are optional, so vibe check them if you want. π
if anything goes sideways while it's building, it raises an exception. so wrap it or weep. π
π« the getters
$host->get_hostname$host->get_username$host->get_port$host->get_master$host->get_geometry$host->get_type
These ones return specific details about the host. just, you know, hand them over. π€²
π« the setters
$host->set_username$host->set_port$host->set_master$host->set_geometry$host->set_type
And these ones set specific details about the host β but only after it's already been created. post-creation glow-up energy. β¨
π« get_realname
If the server name you gave it is not an IP address (and we mean either IPv4 or IPv6, both count, don't play π), it attempts to resolve it and returns the discovered names. it's giving detective. π
π« get_givenname
Alias to get_hostname, and you specifically want it when get_realname might return something different. iykyk. π
π« parse_host_string
Given a host string, it returns a host object. Parses hosts such as... and then, okay, the original page just parks the whole list of formats further down, so that's exactly where we're putting it too. scroll a lil. π«Ά
π« check_ssh_hostname
Checks the object's hostname to see whether or not it may be configured within the user's $HOME/.ssh/config configuration file. yes, that config file. the one you've been editing at 2am. π
π« read_ssh_file
A method to ease reading in ssh configuration files. Used for grabbing hostnames for validation when used in clusters. π§
and here's the list of host shapes it copes with (this is literally where the original drops it, right here, no we did not move it):
host192.168.0.1user@hostuser@192.168.0.1host:port[1234:1234:1234::4567]:port1234:1234:1234::4567
and so on. π
It copes with IPv4 and IPv6 addresses β but it raises a warning if the IPv6 address is ambiguous. like, in that last example: is the 4567 part of the IPv6 address, or is it a port definition?? bestie it does not know. it assumes it is part of the address. π
Use brackets to avoid seeing the warning. that's the fix, that's the whole fix, brackets. π
perl v5.42.2 Β· 2026-05-05 Β· App::C...H::Host(3pm)
okay that's the whole page, go ssh somewhere cute, ily, bye πβ¨π
π¦ where this page comes from
- fedora 43: clusterssh 4.19-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: clusterssh 4.19-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms