Perlanet::Role::Config(3pm)

Perlanet::Role::Config3pm

A role to be used in perlanet traits that read config.

Usage

   package Perlanet::Trait::MyConfig;
   use Moose::Role;
   with 'Perlanet::Role::Config';
  # Class method to return the config
  sub get_config_from_somewhere {
    my $class = shift;
    # get_config() is defined in this role
    return $class->get_config(@_)
  }
  # get_config() calls this to actually read the config.
  sub read_config {
    my $class = shift;
    my %params = @_;
    my $cfg = ...;
    return $cfg;
  }

Overview

A role that is used to build Perlanet traits which read config information from various sources.

This role does two things:

•

It exposes a method called "get_config()" which gets the raw config data (using your "read_config()" method).

•

It forces your trait to define a method called "read_config()" which actually reads the config and returns it as a hash reference.

Methods

get_config

Calls your "read_config()" method to actually get the config data (as a hash reference) and then munges that data in various ways to get a useful config hash.

THIRTY_DAYS

Constant to define the default cache expiration time in seconds.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Author

Dave Cross, <[email protected]>

From libperlanet-perl 2.2.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.