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
Data::Domain::Dependencies(3) User Contributed Perl Documentation Data::Domain::Dependencies(3)

Data::Domain::Dependencies - give Data::Domain the same magic as Params::Validate::Dependencies

A sub-class of Data::Domain which provides functions and objects to let Data::Domain use the same functions as Params::Validate::Dependencies.

NB now this only works on perl 5.18 and higher as Data::Domain uses some features of more modern perls.

As of version 2.00, Data::Domain::Dependencies no longer has the "generate_documentation" method. This is because of incompatible changes in the Data::Domain API. If you need this method then you should use Data::Domain::Dependencies version 1.41, and Data::Domain version 1.13.

See <https://github.com/DrHyde/perl-modules-Params-Validate-Dependencies/issues/28>

This creates a domain which, when passed a hashref to inspect, will check that it contains at least one of an 'alpha' or 'beta' key, or both of 'foo' and 'bar'.

  use Data::Domain::Dependencies qw(:all);
  my $domain = Dependencies(
    any_of(
      qw(alpha beta),
      all_of(qw(foo bar))
    )
  );
  my $errors = $domain->inspect(\%somehash);

Nothing is exported by default, but you can export any of the *_of functions of Params::Validate::Dependencies, and the 'Dependencies' and 'exclusively' functions. They are all available under the 'all' tag.

This takes a code-ref argument as returned by the *_of functions.

It returns an object which is a sub-class of Data::Domain::Dependencies and so has an 'inspect' method that you can use to check for errors when passing it a hash-ref.

'Dependencies' above is really just a thin wrapper around this constructor. You are encouraged to not call this directly.

Some of the above is incorrect. If you really want to know what's going on, look at Params::Validate::Dependencies::Extending.

I like to know who's using my code. All comments, including constructive criticism, are welcome.

Please report any bugs either by email or at <https://github.com/DrHyde/perl-modules-Params-Validate-Dependencies/issues>.

Bug reports should contain enough detail that I can replicate the problem and write a test. The best bug reports have those details in the form of a .t file. If you also include a patch I will love you for ever.

Params::Validate::Dependencies

Data::Domain

<git://github.com/DrHyde/perl-modules-Params-Validate-Dependencies.git>

<https://github.com/DrHyde/perl-modules-Params-Validate-Dependencies/>

Copyright 2024 David Cantrell <david@cantrell.org.uk>

This software is free-as-in-speech software, and may be used, distributed, and modified under the terms of either the GNU General Public Licence version 2 or the Artistic Licence. It's up to you which one you use. The full text of the licences can be found in the files GPL2.txt and ARTISTIC.txt, respectively.

This module is also free-as-in-mason.

2024-01-24 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.