in reply to Exporting functions into main namespace for the benefit of other use'd modules
Under @EXPORT place all of the subroutines that will use in all your other modules, and then call it like so:package YourModule; require Exporter; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); @EXPORT = qw(get_id AnotherSub); @EXPORT_OK = qw(evenMoreSubs justOneMore);
If you include the :DEFAULT tag, it will use all subroutines from @EXPORT. This should do what you're looking for. Cheers!use YourModule qw (:DEFAULT); use strict; my $id = get_id();
|
|---|