Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move the bytes.pm preprocessing from Makefile.PL to

ExtUtils::MakeMaker's PM_FILTER.
  • Loading branch information...
commit b7ea33395dd2225f325c18b236a5fbc1e0ddeec2 1 parent 06f6414
@rcaputo authored
View
51 Makefile.PL
@@ -67,37 +67,6 @@ if($ret =~ /^Y$/i) {
print "\n";
-# Comment out "use bytes" if it's not supported.
-
-use File::Find;
-my $code;
-if ($] < 5.006) {
- print "Perl $] does not support bytes.pm. Commenting it out...\n";
- $code = 's/^(\s*)(use bytes;).*/$1#$2 # perl version $] at install/';
-}
-else {
- print "Perl $] supports bytes.pm. Ensuring it's in...\n";
- $code = 's/^(\s*)#\s*(use bytes;).*/$1$2/';
-}
-
-find(
- sub {
- return unless -f and /\.pm$/;
- system($^X, "-p", "-i.pp", "-e", $code, $_) and die "System error: $!";
- },
- "lib"
-);
-
-find(
- sub {
- return unless -f and /\.pp$/;
- unlink $_;
- },
- "lib"
-);
-
-print "\n";
-
# Which kind of makefile should we build?
if ($] < 5.005004) {
@@ -121,24 +90,4 @@ else {
require "./mylib/Makefile-5005.pm";
}
-# And finally, ask the user to run a test report.
-#
-# NOTE: This is currently disabled. Don't use it.
-#
-# use Config;
-# my $make = $Config::Config{make};
-#
-# print(
-# "\n",
-# "=======================================================================\n",
-# "\n",
-# "Please consider running '$make uploadreport' to create and upload a\n",
-# "test report. You can see samples of other test reports by visitng\n",
-# "http://eekeek.org/poe-tests/\n",
-# "\n",
-# "Thank you.\n",
-# "\n",
-# "=======================================================================\n",
-# );
-
0;
View
3  mylib/Makefile-5004.pm
@@ -54,8 +54,9 @@ WriteMakefile(
FILES => CLEAN_FILES,
},
- PL_FILES => { },
+ PL_FILES => { },
PREREQ_PM => { CORE_REQUIREMENTS },
+ PM_FILTER => 'mylib/preprocessor.perl',
);
1;
View
1  mylib/Makefile-5005.pm
@@ -137,6 +137,7 @@ WriteMakefile(
PL_FILES => { },
NO_META => 1,
PREREQ_PM => { CORE_REQUIREMENTS },
+ PM_FILTER => 'mylib/preprocessor.perl',
);
1;
View
5 mylib/preprocessor.perl
@@ -5,7 +5,10 @@
while (<STDIN>) {
if ($] < 5.006) {
- s/^(\s*)(use bytes;)$/$1#$2 # perl was $] at install time./;
+ s/^(\s*)(use bytes;).*/$1#$2 # perl version $] at install/;
+ }
+ else {
+ s/^(\s*)#\s*(use bytes;).*/$1$2/;
}
print;
}
Please sign in to comment.
Something went wrong with that request. Please try again.