I am trying to write a Perl module that exports a group of names and I can't seem to get it to work. It must be something obvious that I am not seeing.
This is my module in the file "tmod.pm" in the current directory:
package tmod; use 5.20.0; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw($v0 $v1 $v2); our %EXPORT_TAGS = (tag_v0=>[qw($v0)]); our $v0=0; our $v1=1; our $v2=''; 1;
And this is my test script:
use 5.20.0; use strict; use warnings; use Carp; use tmod qw(tag_v0); say "done"; exit;
The result is:
perl test_tmod.pl "tag_v0" is not exported by the tmod module Can't continue after import errors at test_tmod.pl line 5. BEGIN failed--compilation aborted at test_tmod.pl line 5.
I am running Citrus Perl 5.24.01 under Windows 10
All help will very much appreciated.
David
In reply to EXPORT_TAGS does not export a defined tag by perlpipe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |