3 use Exporter qw/import/;
4 use Scalar::Util qw/blessed/;
11 our $AUTHORITY = 'cpan:BERLE';
13 our @EXPORT_OK = qw/can_role/;
16 my ($class,$does) = @_;
18 return ((!ref $class && eval { $class->isa ('UNIVERSAL') }) || Scalar::Util::blessed ($class))
19 && $class->can ('does')
20 && $class->does ($does);
31 Moose::Util - Moose utilities
35 use Moose::Util qw/can_role/;
37 if (can_role ($object,'rolename')) {
38 print "The object can do rolename!\n";
47 can_role ($object,$rolename);
49 Returns true if $object can do the role $rolename.
55 All complex software has bugs lurking in it, and this module is no
56 exception. If you find a bug please either email me, or add the bug
61 Anders Nor Berle E<lt>debolaz@gmail.comE<gt>
63 =head1 COPYRIGHT AND LICENSE
65 Copyright 2007 by Infinity Interactive, Inc.
67 L<http://www.iinteractive.com>
69 This library is free software; you can redistribute it and/or modify
70 it under the same terms as Perl itself.