perlpipe has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: EXPORT_TAGS does not export a defined tag
by Athanasius (Archbishop) on Nov 30, 2017 at 03:38 UTC | |
by Anonymous Monk on Nov 30, 2017 at 15:28 UTC | |
|
Re: EXPORT_TAGS does not export a defined tag
by huck (Prior) on Nov 30, 2017 at 03:39 UTC | |
|
Re: EXPORT_TAGS does not export a defined tag
by choroba (Cardinal) on Nov 30, 2017 at 08:36 UTC | |
|
Re: EXPORT_TAGS does not export a defined tag
by beech (Parson) on Nov 30, 2017 at 03:43 UTC | |
|
Re: EXPORT_TAGS does not export a defined tag
by stevieb (Canon) on Nov 30, 2017 at 04:22 UTC |