-use Module::Build;
-
-use strict;
-
-my $build = Module::Build->new(
- module_name => 'Class::C3',
- license => 'perl',
- requires => {
- 'Algorithm::C3' => 0.06,
- 'Scalar::Util' => 1.10,
- },
- recommends => {
- 'Class::C3::XS' => 0.02,
- },
- build_requires => {
- 'Test::More' => '0.47',
- },
- create_makefile_pl => 'traditional',
- recursive_test_files => 1,
- add_to_cleanup => [
- 'META.yml', '*.bak', '*.gz', 'Makefile.PL',
- ],
-);
-
-$build->create_build_script;
-
+# Dear Distribution Packager. This use of require is intentional.
+# Module::Install detects Build.PL usage and acts accordingly.
+require 'Makefile.PL';
Revision history for Perl extension Class::C3.
+0.15_06
+ - Converted to Module::Install
+ - No deps w/ 5.9.5+
+ - Cleaned up the BEGIN stuff a bit
+ - Added support for C::C3::XS 0.01_07
- Fixed overload fallback edge cases.
0.15_05 Thurs, Apr 19, 2007
--- /dev/null
+
+Please package this dist using Perl < 5.9.5, so that the deps show up in META.yml
Build.PL
ChangeLog
+inc/Module/AutoInstall.pm
+inc/Module/Install.pm
+inc/Module/Install/AutoInstall.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Build.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
lib/Class/C3.pm
lib/Class/C3/next.pm
Makefile.PL
t/21_C3_with_overload.t
t/22_uninitialize.t
t/23_multi_init.t
+t/24_more_overload.t
t/30_next_method.t
t/31_next_method_skip.t
t/32_next_method_edge_cases.t
^blibdirs$
\.old$
^#.*#$
-^\.#
\ No newline at end of file
+^\.#
+\.gz$
+DEV_README
--- /dev/null
+use inc::Module::Install;
+
+name 'Class-C3';
+all_from 'lib/Class/C3.pm';
+
+# Class::C3 under 5.9.5+ has no deps
+if($] < 5.009_005) {
+ build_requires 'Test::More' => '0.47';
+
+ feature 'XS Speedups',
+ ($] < 5.009_005 ? ('Class::C3::XS' => '0.02') : ());
+
+ # Would like to disable these if they answer yes above too ...
+ feature '-core',
+ 'Algorithm::C3' => '0.06',
+ 'Scalar::Util' => '1.10';
+}
+
+auto_install;
+WriteAll;
-Class::C3 version 0.15_01
+Class::C3 version 0.15_06
===========================
INSTALLATION
Additionally, this module will optionally take advantage of
these if installed:
- Class::C3::XS 0.01_06
+ Class::C3::XS 0.01_07
-SPECIAL NOTE FOR 0.15_05
+SPECIAL NOTE FOR 0.15_06
To try this with the new perl core c3 support,
download the most recent copy perl-current:
sh Configure -Dusedevel -Dprefix=/where/I/want/it -d -e && make && make test && make install
-then try your C3-using software against this perl + Class::C3 0.15_05.
+then try your C3-using software against this perl + Class::C3 0.15_06.
COPYRIGHT AND LICENCE
use strict;
use warnings;
-our $VERSION = '0.15_05';
+our $VERSION = '0.15_06';
our $C3_IN_CORE;
our $C3_XS;
BEGIN {
- if($^V < 5.009005) {
+ if($] > 5.009_004) {
+ $C3_IN_CORE = 1;
+ }
+ else {
eval "require Class::C3::XS";
- if(my $error = $@) {
+ my $error = $@;
+ if(!$error) {
+ $C3_XS = 1;
+ }
+ else {
die $error if $error !~ /\blocate\b/;
require Algorithm::C3;
require Class::C3::next;
}
- else {
- $C3_XS = 1;
- }
- }
- else {
- $C3_IN_CORE = 1;
}
}
}, $merge_cache);
}
+# Method overrides to support 5.9.5+ or Class::C3::XS
+
sub _core_calculateMRO { @{mro::get_linear_isa($_[0])} }
if($C3_IN_CORE) {
D->can('hello')->(); # can() also works correctly
UNIVERSAL::can('D', 'hello'); # as does UNIVERSAL::can()
-=head1 SPECIAL NOTE FOR 0.15_05
+=head1 SPECIAL NOTE FOR 0.15_06
To try this with the new perl core c3 support,
download the most recent copy perl-current:
sh Configure -Dusedevel -Dprefix=/where/I/want/it -d -e && make && make test && make install
-then try your C3-using software against this perl + Class::C3 0.15_05.
+then try your C3-using software against this perl + Class::C3 0.15_06.
=head1 DESCRIPTION
=head1 COMPATIBILITY
-If your software requires Perl 5.9.5 or higher, you do not need L<Class::C3>, you can simple C<use mro 'c3'>, and not worry about C<initialize()>, avoid some of the above caveats, and get the best possible performance. See L<mro> for more details.
+If your software requires Perl 5.9.5 or higher, you do not need L<Class::C3>, you can simply C<use mro 'c3'>, and not worry about C<initialize()>, avoid some of the above caveats, and get the best possible performance. See L<mro> for more details.
If your software is meant to work on earlier Perls, use L<Class::C3> as documented here. L<Class::C3> will detect Perl 5.9.5+ and take advantage of the core support when available.