Re: detecting primary types

[email protected] (Karen Etheridge)
Newsgroups perl.moose
Message-ID <[email protected]>
On Fri, Oct 26, 2012 at 09:00:27PM +0000, Jeff Benton wrote:
> Is there a way to tell if a moose attribute type is a primary type?  For example, I want to tell the difference between an attribute that is a Str and an attribute that is some type of reference.

my $type = Moose::Util::TypeConstraints::find_or_create_type_constraint($type_name);
print "$type_name is a reference!\n" if $type->is_a_type_of('Ref');
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.