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

Module export list for one-liners

Thread Next
From:
Ed Avis
Date:
July 16, 2014 09:50
Subject:
Module export list for one-liners
Message ID:
loom.20140716T114621-376@post.gmane.org
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 <eda@waniasset.com>


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About