---
name: "App::ClusterSSH::Base"
section: "3pm"
platform: "linux"
package: "clusterssh"
version: "4.18-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/App::ClusterSSH::Base"
---

# App::ClusterSSH::Base(3pm)

## 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

Base object to provide some utility functions on objects - should not be  used directly

## METHODS

These extra methods are provided on the object

- $obj = App::ClusterSSH::Base-\>new({ arg =\> val, });

  Creates object.  In higher debug levels the args are printed out.

- $obj-\>id

  Return the unique id of the object for use in subclasses, such as

  ```
      $info_for{ $self->id } = $info
  ```

- $obj-\>**debug\_level()**;

  Returns current debug level

- $obj-\>set\_debug\_level( n )

  Set debug level to 'n' for all child objects.

- $obj-\>debug($level, @text)

  Output `@text` on STDOUT if `$level` is the same or lower that debug\_level

- $obj-\>set\_lang

  Set the Locale::Maketext language.  Defaults to 'en'.  Expects the  App::ClusterSSH/L10N/{lang}.pm module to exist and contain all relevant  translations, else defaults to English.

- $obj-\>loc('text to translate \[\_1\]')

  Using the App::ClusterSSH/L10N/{lang}.pm module convert the  given text to  appropriate language.  See App::ClusterSSH::L10N for more details.  Essentially  a wrapper to maketext in Locale::Maketext

- $obj-\>stdout\_output(@);

  Output text on STDOUT.

- $obj-\>parent;

  Returned the object that is the parent of this one, if it was set when the  object was created

- %obj-\>options;

  Accessor to configured options, if it is set up by this point

- $obj-\>exit;

  Stub to allow program to exit neatly from wherever in the code

- $config = $obj-\>config;

  Returns whatever configuration object has been set up.  Croaks if set\_config hasnt been called

- $obj-\>set\_config($config);

  Set the config to the given value - croaks if has already been called

- $sort = $obj-\>sort

  Code reference used to sort lists; if configured (and installed) use Sort;:Naturally, else use perl sort

- %results = $obj-\>load\_file( filename =\> '/path/to/file', type =\> '(cluster\|config}' )

  Load in the specified file and return a hash, parsing the file depending on wther it is a config file (key = value) or cluster file (key value)
