Load mro directly if Perl is recent enough (Nicholas Clark)
[gitmo/Mouse.git] / lib / Mouse / Util.pm
index 7dc8187..d8b93e2 100644 (file)
@@ -1,13 +1,10 @@
-#!/usr/bin/env perl
 package Mouse::Util;
 use strict;
 use warnings;
 use base qw/Exporter/;
 use Carp;
-use Scalar::Util qw(blessed looks_like_number openhandle reftype weaken);
 
 our @EXPORT_OK = qw(
-    blessed looks_like_number openhandle reftype weaken
     get_linear_isa
 );
 our %EXPORT_TAGS = (
@@ -17,6 +14,7 @@ our %EXPORT_TAGS = (
 BEGIN {
     my $impl;
     if ($] >= 5.009_005) {
+        require mro;
         $impl = \&mro::get_linear_isa;
     } else {
         my $loaded = do {
@@ -58,6 +56,8 @@ sub apply_all_roles {
     my $meta = Mouse::Meta::Class->initialize(shift);
 
     my @roles;
+
+    # Basis of Data::OptList
     my $max = scalar(@_);
     for (my $i = 0; $i < $max ; $i++) {
         if ($i + 1 < $max && ref($_[$i + 1])) {
@@ -101,26 +101,5 @@ Mouse::Util - features, with or without their dependencies
 
 =head3 get_linear_isa
 
-=head2 L<Scalar::Util>
-
-=head3 blessed
-
-=head3 looks_like_number
-
-=head3 reftype
-
-=head3 openhandle
-
-=head3 weaken
-
-C<weaken> I<must> be implemented in XS. If the user tries to use C<weaken>
-without L<Scalar::Util>, an error is thrown.
-
-=head2 Test::Exception
-
-=head3 throws_ok
-
-=head3 lives_ok
-
 =cut