I agree with most of your points, but handrolling your own exporter really isn't all that bad 1. If you look through Exporter.pm, you'll find that most of it is just syntactic sugar around the following bit of code 2 that looks remarkably similiar to what you noted:
*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}
There is also a nearly identical call for $vars and @arrays and %hashes, etc. Exporter.pm is mainly just a nicer interface for this admitedly scary chunk of code.
1Assuming you're Lincoln Stein
2From 5.005_03 since I once disected its Exporter.pm for fun
-Blake
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|