NAME

Tie::Moose::FallbackHash - provide a fallback hashref for unknown attributes

SYNOPSIS

        my %data;
        tie(
                my %bob,
                "Tie::Moose"->with_traits("FallbackHash"),
                $bob, fallback => \%data,
        );
        
        $bob{xyz} = 123;   # $bob doesn't have an attribute called "xyz"
        say $data{xyz};    # ... so this gets stored in the fallback hash

DESCRIPTION

Usually if you try to store data against a hash key which does not have a corresponding attribute in the underlying Moose object, Tie::Moose will throw an exception. This module allows you to instead store it into a fallback hash.

The fallback hash can itself be a tied hash, or an object which overloads %{}, so this allows for some interesting possibilities.

BUGS

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Tie-Moose.

SEE ALSO

Tie::Moose.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2013 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.