Declare::Constraints::Simple::Library::Exportable(3pm)

Declare::Constraints::Simple::Library::Exportable3pm

Export facilities

Overview

This contains the constraint export logic of the module.

Methods

import($flag, @args)

  use ExportableModule->All;
  # or
  use ExportableModule-Only => qw(Constraint1 ...);
  # or
  use ExportableModule-Library;

Exports the constraints to the calling namespace. This includes all libraries in Declare::Constraints::Simple::Library, that package itself (providing all default constraints) or Declare::Constraints::Simple itself as a shortcut.

Possible flags are

All

Imports all constraints registered in the class and its base classes.

Only
  use Declare::Constraints::Simple::Library::Scalar-Only => 'HasLength';

The above line would only import the "HasLength" constraints from the "Scalar" default library. Note however, that you could also just have said

  use Declare::Constraints::Simple-Only => 'HasLength';

as both "::Simple" and "::Simple::Library" work on all default libraries.

Library

You can use this to define your own constraint library. For more information, see Declare::Constraints::Simple::Library::Base.

_build_handle_map()

Internal method to build constraint-to-class mappings.

_export_all($target, $handle_map)

Internal method. Exports all handles in $handle_map into the $target namespace.

_export_these($target, $handle_map, @constraints)

Internal method. Exports all @constraints from $handle_map into the $target namespace.

Releases

4 releases since Debian 10 (Buster); the text changed 1 time.

  1. 10
  2. 11–13

Author

Robert 'phaylon' Sedlacek "<[email protected]>"

From libdeclare-constraints-simple-perl 0.03-1.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.