[Catalyst-commits] r9030 - in trunk/CatalystX-Imports: .
lib/CatalystX lib/CatalystX/Imports
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Wed Jan 7 19:16:38 GMT 2009
Author: groditi
Date: 2009-01-07 19:16:37 +0000 (Wed, 07 Jan 2009)
New Revision: 9030
Modified:
trunk/CatalystX-Imports/Makefile.PL
trunk/CatalystX-Imports/lib/CatalystX/Imports.pm
trunk/CatalystX-Imports/lib/CatalystX/Imports/Context.pm
Log:
fix for catalyst 5.8
Modified: trunk/CatalystX-Imports/Makefile.PL
===================================================================
--- trunk/CatalystX-Imports/Makefile.PL 2009-01-07 18:29:58 UTC (rev 9029)
+++ trunk/CatalystX-Imports/Makefile.PL 2009-01-07 19:16:37 UTC (rev 9030)
@@ -17,6 +17,7 @@
requires q{Catalyst::Runtime}, '5.7000';
requires q{Data::Alias}, '0.08';
requires q{Class::C3}, '0.14';
+requires q{Sub::Name}, '0.04';
test_requires q{Test::More}, '0.62';
test_requires q{FindBin}, 0;
Modified: trunk/CatalystX-Imports/lib/CatalystX/Imports/Context.pm
===================================================================
--- trunk/CatalystX-Imports/lib/CatalystX/Imports/Context.pm 2009-01-07 18:29:58 UTC (rev 9029)
+++ trunk/CatalystX-Imports/lib/CatalystX/Imports/Context.pm 2009-01-07 19:16:37 UTC (rev 9030)
@@ -22,6 +22,7 @@
use Scalar::Util qw( set_prototype );
use Carp::Clan qw{ ^CatalystX::Imports(?:::|$) };
use Filter::EOF;
+use Sub::Name 'subname';
$EXPORT_MAP_NAME = 'CATALYSTX_IMPORTS_EXPORT_MAP';
$DEFAULT_LIBRARY = __PACKAGE__ . '::Default';
@@ -365,11 +366,12 @@
# install the export, include prototype if specified
{ no strict 'refs';
- my $name = $export_info->{name};
- *{ "${target}::${name}" }
- = defined $prototype
+ my $name = join('::',$target, $export_info->{name});
+ *$name = subname $name, (
+ defined $prototype
? set_prototype sub { $export_code->(@_) }, $prototype
- : $export_code;
+ : $export_code
+ );
}
return 1;
Modified: trunk/CatalystX-Imports/lib/CatalystX/Imports.pm
===================================================================
--- trunk/CatalystX-Imports/lib/CatalystX/Imports.pm 2009-01-07 18:29:58 UTC (rev 9029)
+++ trunk/CatalystX-Imports/lib/CatalystX/Imports.pm 2009-01-07 19:16:37 UTC (rev 9030)
@@ -18,6 +18,7 @@
use Class::Inspector;
use Carp::Clan qw{ ^CatalystX::Imports(?:::|$) };
use Filter::EOF;
+use Sub::Name 'subname';
=head1 VERSION
@@ -249,7 +250,8 @@
# replace code reference in package
{ no strict 'refs';
no warnings 'redefine';
- *{ "${target}::$methods{$original}" } = $wrapped;
+ my $method_name = "${target}::$methods{$original}";
+ *$method_name = subname $method_name, $wrapped;
}
}
More information about the Catalyst-commits
mailing list