From: gfx Date: Wed, 7 Oct 2009 05:40:25 +0000 (+0900) Subject: Make Mouse::Exporter to provide export_to_level() and export() for backward compatibility X-Git-Tag: 0.37_03~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d794b33466a638e2b8d1dbc1b184773380c14b3c;p=gitmo%2FMouse.git Make Mouse::Exporter to provide export_to_level() and export() for backward compatibility --- diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index 05bd169..881a6aa 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -110,6 +110,17 @@ sub setup_import_methods{ *{$exporting_package . '::import'} = \&do_import; *{$exporting_package . '::unimport'} = \&do_unimport; + # for backward compatibility + + *{$exporting_package . '::export_to_level'} = sub{ + my($package, $level, @args) = @_; + do_import($package, { into_level => $level + 1 }, @args); + }; + *{$exporting_package . '::export'} = sub{ + my($package, $into, @args) = @_; + do_import($package, { into => $into }, @args); + }; + return; }