Subject: | IMPORT Block Arguments Containing Export Specifications |
Date: | Tue, 30 May 2006 16:07:55 +0100 |
To: | bug-perl6-export-attrs [...] rt.cpan.org |
From: | Smylers <Smylers [...] stripey.com> |
Hi there. Thanks for Perl6::Export::Attrs; it seems to be just what I'm
looking for.
However, I'm finding this bit of functionality doesn't seem to be there:
The IMPORT block is passed the argument list that was specified on the
use line that loaded the corresponding module. However, any export
specifications (names of subroutines or tagsets to be exported) will
have already been removed from that argument list before IMPORT
receives it.
My IMPORT blocks are getting all the arguments, even those which've
already been processed. Here's an example module:
package ExportTest;
use Perl6::Export::Attrs;
sub IMPORT { print "IMPORT block with these args [@_].\n" }
sub hello :Export { print "Hello\n" }
1;
Loading that module yields:
$ perl -MExportTest=hello,extra -we 1
This is the custom IMPORT block, with these args [hello extra].
Whereas I'd've expected "hello" to've been stripped and only for "extra"
to've made it to the output.
Also, I had to put "sub" before "IMPORT" to get the module to compile --
but that was easy to sort out, so it's bothering me much less!
Cheers.
Smylers