Hash::Typed - Ordered typed tied hashes.
Version 0.05
use Hash::Types; use Types::Standard qw/Int Str ArrayRef/; my $test = Hash::Typed->new( [ strict => 1, required => 1, # all keys are required on instantiation keys => [ one => Int, two => Str, three => ArrayRef, four => sub { return 1 }, five => sub { Hash::Typed->new( [ strict => 1, required => [qw/one/], keys => [ one => Int ] ], %{$_[0]} ); } ] ], ( three => [qw/a b c/], two => 'def', one => 211, four => undef, five => { one => 633 } ) ); $test->{one} = "not okay"; # errors as does not pass Int type constraint. ... tie my %test, 'Hash::Typed', [ strict => 1, required => [qw/one two three four/], keys => [ one => Int, two => Str, three => ArrayRef, four => sub { return 1 }, five => sub { Hash::Typed->new(@{$_[0]}); } ] ], ( three => [qw/a b c/], two => 'def', one => 211, four => undef, five => [ [keys => [ one => Int ]], one => 633 ] );
...
{ one => 211, two => 'def', three => [qw/a b c/], four => 1, five => { one => 633 } }
LNATION, <email at lnation.org>
<email at lnation.org>
Please report any bugs or feature requests to bug-hash-typed at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Hash-Typed. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-hash-typed at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Hash::Typed
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Hash-Typed
CPAN Ratings
https://cpanratings.perl.org/d/Hash-Typed
Search CPAN
https://metacpan.org/release/Hash-Typed
This software is Copyright (c) 2022 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Hash::Typed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hash::Typed
CPAN shell
perl -MCPAN -e shell install Hash::Typed
For more information on module installation, please visit the detailed CPAN module installation guide.