Exporting functions by attributes
Matt Lawrence
matt.lawrence at virgin.net
Fri Oct 12 09:31:00 BST 2007
Ovid wrote:
> --- Matt S Trout <dbix-class at trout.me.uk> wrote:
>
>
>>> For the record, Exporter::Simple does what I had in mind - you can
>>>
>> tag
>>
>>> functions with attributes Exported or Exportable (exported by
>>>
>> default or
>>
>>> optionally). More info in their docs.
>>>
>> I'd just suck it up and use Sub::Exporter, which is much nicer than
>> anything
>> else I've found.
>>
>
> ++
>
> Bonus: no inheritance required. If I have to deal with one more
> module which forces me to inherit just because the author thought it
> was a good idea, I'm going to go insane.
>
> So, let's say I need a factory class, with class data, don't want to
> worry about missing methods and want handy method generation.
>
> Where's the bug?
>
> package Hate;
>
> # Hmm, better sort these so they're easy to read ...
>
> use base qw(
> Class::Accessor
> Class::BlackHole
> Class::Data::Inheritable
> Class::Factory
> );
>
I'm guessing that BlackHole has to go last?
Matt
More information about the london.pm
mailing list