develooper Front page | perl.perl5.porters | Postings from July 2014

Module export list for one-liners

Thread Next
Ed Avis
July 16, 2014 09:50
Module export list for one-liners
Message ID:
In the old days, it was common to write your module with Exporter and have a
hefty @EXPORT list of functions exported into the caller's namespace by
default.  Nowadays that is often considered messy, and @EXPORT_OK is used
instead so that you have to explicitly ask for the functions you want.  That
is good for writing maintainable programs.

But for one-liners and throwaway scripts, it is more awkward.  Would it fly
to introduce a third export list, @EXPORT_ONELINER, which applies only with
the -M argument on perl's command line?  By default, @EXPORT_ONELINER would
be the union of @EXPORT and @EXPORT_OK.

Ed Avis <>

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About