use strict;
use warnings;
... and perhaps ...
use 5.008_003;
(because older perls may have older Exporters), then the code looks quite good.
Next step is to think about stopping exporting without explicit request (i.e. move exports from @EXPORT to @EXPORT_OK, think about %EXPORT_TAGS, learn about tag handling utility functions in Exporter).
Then, you could re-think your design. Do you really need to export a variable? Perhaps an object is a much better solution for your problem.
On the other hand, sometimes exporting a variable is the best solution. In some situations, exporting it by default is even better than exporting on demand.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
|