Make Mouse::Exporter to provide export_to_level() and export() for backward compatibility
gfx [Wed, 7 Oct 2009 05:40:25 +0000 (14:40 +0900)]
lib/Mouse/Exporter.pm

index 05bd169..881a6aa 100644 (file)
@@ -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;
 }