Joshua,

> 2. It sounds like given the single function and it's relative uniqueness,
> there's no problem exporting it by default other than not being able to change
> it later.  For the sake of forward compatibility, I'll probably just put it in
> @EXPORT_OK and require its explicit import.

Bearing in mind that I am but one voice, and therefore taking my
opinion with the appropriate number of grains of salt, I'll give you
my view on the question of to export or not to export.

When a module has several functions that I may or may not need, I
prefer it to export nothing (e.g. List::Util, List::MoreUtils).  When
it has exactly one function, and my use of that function is the entire
point of my including the module in the first place, I prefer it to
export that function (e.g. Date::Format, Date::Parse).  Even if it's
two functions, if they're very closely related, I'd prefer them to be
exported by default (e.g. File::Basename).  When a module has exactly
one purpose in life, which is to call a function, and it doesn't
export it (e.g. Sub::Install), that irks me a little bit, as it forces
me to do it myself, and it just seems redundant.  As Eric mentions,
it's not like I don't know how to stop the export if I really don't
want it.

Just my perspective, mostly as a user rather than author (but also an
author of a few things here and there).


            -- Buddy

Reply via email to