I need to convert a 'use' statement in my Perl code to 'require' statement to import some %EXPORT_TAGS from another module. The module that I am "use"ing is a plain .pm file (not a class with constructor).
Below is the snippet of the MyModule.pm file
package MyModule;
use Exporter qw(import);
our %EXPORT_TAGS = ( 'tag1' => [qw (func1 func2)],
'tag2' => [qw (func3 func4)]
);
our @EXPORT_OK = qw (func1 func2 func3 func4);
sub func1 {
#some statement
}
# similary other functions written ...
The "use" statement that I have tried from my script looks like below:
use MyModule qw(:tag1 :tag2);
Now I need to convert it to a "require" statement. I tried what is suggested here as below but of no help :
require MyModule;
MyModule->import;
One Limitation, that is : This MyModule.pm is used in other scripts by "use" statement so I cannot remove %EXPORT_TAGS and @EXPORT_OK;
Any help to write me the correct and working "require" syntax will be highly appreciated.
Thanks in advance.