[Catalyst-commits] r9771 - in Catalyst-Devel/1.00/trunk: . t t/lib
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Apr 21 06:56:29 GMT 2009
Author: caelum
Date: 2009-04-21 07:56:29 +0100 (Tue, 21 Apr 2009)
New Revision: 9771
Added:
Catalyst-Devel/1.00/trunk/t/lib/
Catalyst-Devel/1.00/trunk/t/lib/UnknownError.pm
Modified:
Catalyst-Devel/1.00/trunk/Makefile.PL
Log:
Add "Unknown error" check
Modified: Catalyst-Devel/1.00/trunk/Makefile.PL
===================================================================
--- Catalyst-Devel/1.00/trunk/Makefile.PL 2009-04-21 03:31:16 UTC (rev 9770)
+++ Catalyst-Devel/1.00/trunk/Makefile.PL 2009-04-21 06:56:29 UTC (rev 9771)
@@ -15,6 +15,48 @@
requires 'Path::Class' => '0.09';
requires 'Template' => '2.14';
+if (!$ENV{CATALYST_DEVEL_NO_510_CHECK}) {
+ use Symbol 'gensym';
+ use IPC::Open3;
+ use File::Spec;
+ open NULL, '>', File::Spec->devnull;
+ my $err = gensym;
+ my $pid = open3(gensym, '&>NULL', $err, "$^X -It/lib -MUnknownError -e 1");
+
+ my $unknown_error = 0;
+
+ while (<$err>) {
+ $unknown_error = 1 if /^Unknown error/;
+ }
+
+ waitpid $pid, 0;
+
+ if ($unknown_error) {
+ warn <<EOE;
+############################### WARNING #################################
+# #
+# You are using perl 5.10.0 with the "Unknown error" bug. This can make #
+# developing Catalyst applications much more painful, as it will come #
+# up with no details every time you have a syntax error in a Controller.#
+# #
+# For more information see: #
+# #
+# * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472 #
+# #
+# It is highly recommended that you patch your perl, or use a different #
+# version for Catalyst development. #
+# #
+# To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment #
+# variable. #
+# #
+#########################################################################
+
+EOE
+ my $ans = prompt('Do you want to continue?', 'no');
+ exit 0 unless $ans =~ /^y(es)?\z/i;
+ }
+}
+
auto_install;
WriteAll;
Added: Catalyst-Devel/1.00/trunk/t/lib/UnknownError.pm
===================================================================
--- Catalyst-Devel/1.00/trunk/t/lib/UnknownError.pm (rev 0)
+++ Catalyst-Devel/1.00/trunk/t/lib/UnknownError.pm 2009-04-21 06:56:29 UTC (rev 9771)
@@ -0,0 +1,8 @@
+# thanks kd
+package UnknownError;
+use strict;
+sub MODIFY_CODE_ATTRIBUTES {}
+sub check : Blah {
+$error = "please explode" ; # deliberate syntax error
+}
+1;
More information about the Catalyst-commits
mailing list