What an awful name (I'm not usually this blunt but it is worse than calling it Exporter::Dandy).
This name was chosen primarily because I couldn't think of any other name. So far, no one likes the name (including me, actually), so you can be sure it won't be put on CPAN using this name. I like Aristotle's suggestion (Exporter::Tidy). Do you have any suggestions?
Exporter::Prefixing would at least be descriptive.
That would describe one of its features, and not some of the others. If I were to release a module specifically to be able to prefix, it would not be a whole new exporter. It'd be something that wraps a lot like
so that it can be used with existing exporters.# untested, written in browser package Exporter::PrefixWrapper; use Carp; sub import { my (undef, $module, $prefix, @symbols) = @_; my $caller = (caller)[0]; eval "package $caller\::__FOO; use $module \@symbols;"; croak $@ if $@; for my $symbol (keys %{ "$caller\::__FOO::" }) { for my $type (qw/CODE SCALAR ARRAY HASH GLOB/) { next if not *{ "$caller\::__FOO::$symbol" }{$type}; *{ "$caller\::$prefix$symbol" } = *{ "$caller\::__FOO::$symbol" }{$type}; } } } 1; =head1 SYNOPSIS use Exporter::PrefixWrapper LWP::Simple => 'lwp_', qw(get $ua); $lwp_ua->agent('FooBar/0.01'); my $page = lwp_get "http://juerd.nl/" =cut
Having lots of choices of similar modules might be nice for people writing scripts (and it might not). But it isn't very nice for people writing modules.
I don't see why not. Most of what I write is modular, and I like having alternatives to choose from.
Now you want people downloading modules to end up downloading 4 or 5 different Exporter modules as well? I don't think the person trying to get a module installed will appreciate this situation.
This is not a problem. People (should) use CPANPLUS (or CPAN.pm) to make downloading modules and prerequisites easy.
I like your couple of little enhancements but don't find them to be nearly enough to justify a new module, especially one for use by module authors.
I want to introduce new syntax as well as a simpler module. I tried to see if this could be added to an existing module, but that would create a mess. Other exporting modules are heavier or have different syntax.
Exporter::Dream (whatever name it will have) is too different to be integrated into an existing exporter module.
Thanks for commenting. Please consider signing up if you can (that is: if you own your own thoughts).
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
In reply to Re: Re: Exporter::Dream
by Juerd
in thread Exporter::Dream
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |