http://qs321.pair.com?node_id=277707


in reply to Re: Re^4: USE or Require?
in thread USE or Require?

exporting new isn't useful. Its there more to say to the user of the module, this is the way in. I'm in the camp that doesn't like namespace pollution, so I try to push my bias along to the next person. Either A) they will instantiate via the constructor, or B) they will have to fully qualify all calls via Package::Name::function

I wasn't having a go at ya - honest! I was attempting to understand you're motivations for having new() in EXPORT_OK, indeed for using Exporter in an OO module at all. Typically an OO constructor wouldn't work if imported into another package.

I'm in complete agreement with your goal of making your code use intentions explicit in the code itself. However, I don't think that putting new() in EXPORT_OK is going to act as a useful cue in the way that you think.

Normally an OO module will not use Exporter at all. If I see an EXPORT_OK my assumption will be that the code isn't OO - exactly the opposite of the point you're trying to get across.