[Melbourne-pm] Exporting functions by attributes

Steve Sabljak steve.sabljak at gmail.com
Mon Oct 8 23:49:40 PDT 2007


If memory serves me, Damian Conway advocates Perl6::Export::Attrs in
Perl Best Practices, which looks like it wooks similarly to
Exporter::Simple. The perldoc for Sub::Exporter has a nice comparison
of the various popular exporter modules
(http://search.cpan.org/~rjbs/Sub-Exporter-0.976/lib/Sub/Exporter.pm#COMPARISONS)
which may be of interest.

cheers,
Steve

On 10/9/07, Toby Corkindale <tjc at wintrmute.net> wrote:
> It occurred to me earlier that exporting functions from modules in the
> traditional way, ie. as given in `perldoc Exporter`, seems poor,
> especially with the availability of function attributes in recent
> versions of Perl.
>
> I had a search around on CPAN, and found that there are already at least
> seven different Exporter variants - Classic, Easy, Easiest, Lite,
> NoWork, Simple and Tidy. (There are probably more, but I stopped looking
> at this point).
>
> 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 thought I'd pass this along as I found it interesting.
> It won't work on older pre-attribute versions of Perl of course.
>
> -Toby
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm
>


More information about the Melbourne-pm mailing list