Maybe you could have an Exporter::Tidy::Compat as a drop in replacement to translate the Exporter interface to the Exporter::Tidy one?
The two modules have different goals, and there is no easy way to translate things automatically.
| Exporter(::Heavy) |
Exporter::Tidy |
| import() is inherited |
import() is imported |
| Uses EXPORT globals |
Gets information during importing |
| Supports tagless operation |
Everything must be in a tag |
| Supports symbol exclusion |
If you request a tag, you always get it entirely |
| Supports pattern matching |
Does not support pattern matching |
| Lets you handle unknown symbols (Foo->export_fail) |
Unknown symbols are not exportable, period |
| Uses numbers to require versions (Foo->require_version) |
Doesn't do any version checking |
| Can export to different levels |
Always exports to its own caller |
Exporter::Tidy can only be this small and fast if it doesn't support those features.
Should Exporter::Tidy ever become the standard exporter, Exporter could then become a stub to load Exporter::Tidy::Compat.
Should Exporter::Tidy ever be renamed to Exporter, then the current Exporter should be named Exporter::Compat, and the new Exporter would need to use AUTOLOAD to load it and goto its methods. And the same if $_[0] ne __PACKAGE__ during import().
But I think it's better to have different names for different things. What do you think, merlyn and Aristotle?
Juerd
- http://juerd.nl/
- spamcollector_perlmonks@juerd.nl (do not use).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.