GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Perlanet::Role::Config(3) User Contributed Perl Documentation Perlanet::Role::Config(3)

Perlanet::Role::Config - A role to be used in Perlanet traits that read config.

   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;
  }

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.

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.

Dave Cross, <dave@perlhacks.com>

Copyright (c) 2022 by Magnum Solutions Ltd.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.

2025-04-29 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.