Hi, 

So to clarify my previous email I currently have the code below but I cannot 
get the attribute 'reasons' coerced into a Tie::IxHash. Any insights would be 
most appreciated.

Many thanks

Bill



use Tie::IxHash;
use Moose;
use Moose::Util::TypeConstraints;

subtype 'IxHash' 
    => as 'HashRef' 
    => where { 
        ref $_ eq 'HASH' 
};

coerce 'IxHash'
=> from 'HashRef'
=> via { 
    tie (%$_,'Tie::IxHash') unless tied $_; return $_; 
    
};

no Moose::Util::TypeConstraints;

has 'reasons' => (
    is  => 'ro', 
    isa => 'IxHash',
    default => sub { {} },
    coerce => 1
);
                                          

Reply via email to