App::C...H::Base(3pm)
β¨ App::C...H::Base β¨
okay bestie, buckle up π this is App::C...H::Base, a lil Perl module living in the 3pm manual section, and it's basically the main character base class that other objects inherit from. she's giving utility-function energy, no cap.
πΈ SYNOPSIS πΈ
use base qw/ App::ClusterSSH::Base /;
# in object new method
sub new {
( $class, $arg_ref ) = @_;
my $self = $class->SUPER::new($arg_ref);
return $self;
}
π¦ DESCRIPTION π¦
So likeβ¦ this is a base object whose whole job is handing out some utility functions to other objects. that's it, that's the vibe. π
lowkey important: this thing should NOT be used directly. she's a foundation, not a whole house. build on top of her, don't move into her. ποΈ
π METHODS π
these extra methods are provided on the object, and honestly? iconic. π
$obj = App::ClusterSSH::Base->new({ arg => val, });β creates the object, periodt. and ooooh at higher debug levels the args get printed out π so everyone can see what you passed in.$obj->idβ hands you back the unique id of the object so subclasses can use it, like this:
$info_for{ $self->id } = $info
$obj->debug_level();β returns whatever the current debug level is, fr fr.$obj->set_debug_level( n )β sets the debug level tonfor all the child objects. one call, whole fam updated. π«Ά$obj->debug($level, @text)β spits@textout onSTDOUTif$levelis the same as or lower thandebug_level. quieter levels stay quiet, bestie. π€«$obj->set_langβ sets theLocale::Maketextlanguage. defaults to'en'. she expects theApp::ClusterSSH/L10N/{lang}.pmmodule to exist and to contain all the relevant translations β and if it doesn't? we default back to English, no drama. π$obj->loc('text to translate [_1]')β uses theApp::ClusterSSH/L10N/{lang}.pmmodule to convert the text you give her into the appropriate language. peepApp::ClusterSSH::L10Nfor the deets. essentially she's just a wrapper aroundmaketextinLocale::Maketext. π$obj->stdout_output(@);β outputs text onSTDOUT. simple, clean, slay. β¨$obj->parent;β returns the object that is the parent of this one, if it was set when the object got created. if notβ¦ she just doesn't have one, and that's valid. π%obj->options;β accessor to the configured options, if it's been set up by this point. timing is everything, bestie.$obj->exit;β a lil stub so your program can exit neatly from wherever in the code it happens to be. graceful queen. π$config = $obj->config;β returns whatever configuration object has been set up. β οΈ she croaks ifset_confighasn't been called β like, excuse me, where is the config??$obj->set_config($config);β sets the config to the value you give. β οΈ croaks if it's already been called β one config only, we don't do seconds around here.$sort = $obj->sortβ a code reference used to sort lists. if it's configured (and installed) she usesSort;:Naturally, otherwise she falls back to plain perlsort. β¨ (yes, that's exactly how it's spelled, i don't make the rules)%results = $obj->load_file( filename => '/path/to/file', type => '(cluster|config}' )β loads in the file you specified and returns a hash. how she parses it depends on whether it's a config file (key = value) or a cluster file (key value). π
aaaand that's the whole page, bestie!! π₯³ the source and version on this one is perl v5.42.2 and it's dated 2026-05-05 β so yeah, she's got history, and she's still serving. πβ¨π go forth and build your subclasses, ily π«Ά
π¦ 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