Subject: | renaming on export_to_import() too |
Date: | Thu, 08 Apr 2010 07:12:41 +1000 |
To: | bug-Exporter-Renaming [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
Exporter::Renaming might subvert export_to_import() to work with modules
which use that in their own import(), per the Exporter pod under
"Exporting without using Exporter's import method". For example the
benchmark.pl program below gets an error
"Renaming" is not exported by the Benchmark module
"ARRAY(0x9bf1590)" is not exported by the Benchmark module
Can't continue after import errors at /usr/share/perl/5.10/Benchmark.pm line 467
BEGIN failed--compilation aborted at benchmark.pl line 4.
That Benchmark.pm seems fairly typical in that it peels off args it
understands then passes the rest to Exporter.
I expect modules which are too smart in their import() still won't work,
but various plainish uses of export_to_import() would be likely.
use strict;
use warnings;
use Exporter::Renaming;
use Benchmark Renaming => [ timethis => 'howfast' ];
howfast (2, sub { sleep 1 });