Should I prefer one of these 4 versions when I use Exporter
in a module which should work with Exporter 5.57 (the one that came with Perl 5.8.3)?
# 1
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(some_func);
# 2
use Exporter;
our *import = \&Exporter::import;
our @EXPORT_OK = qw(some_func);
# 3
use base 'Exporter';
our @EXPORT_OK = qw(some_func);
# 4
use parent 'Exporter';
our @EXPORT_OK = qw(some_func);
Personally I'd tend to use:
use Exporter ();
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(...);
Which will work with every version of Perl and Exporter released this century.
Other ways might be more compact but the above is not exactly onerous to type. And it only needs to be done once per module. The other ways come at the expense of compatibility with older versions of Perl, so I stick with the above.