There is always another way to do it in Perl. One of the crazier ones is to put a function reference in @INC as Abigail does at Re: The Future - Managing Modules. The idea would be that when Perl goes to find your module, you would hand it a filehandle which is going to hand Perl filtered text. All of your modules would only be found this way, so they are all filtered with no per module change. (I have seen a tutorial on how to use this feature of @INC, but I can't find it right now.)
In any case the direction that you are headed for sounds exactly like Aspect-Oriented Programming. If you google for that, you can find discussion of how the direction that you are thinking about has turned out for others in other languages. Of a sample set of one person whom I know who has tried it (I only read a couple of articles), all liked it. For more details, ask him.
UPDATE: The Aspect-Oriented Programming that I was talking about and the AOP that mvc mentions below are the same thing. (I think I knew once that there was a Perl implementation...)
-
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.
|